Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Integrate VBA to QM2
#10
Code:
Copy      Help
Set sourceRange = Worksheets("Sheet1").Range("A1:A2")
Set fillRange = Worksheets("Sheet1").Range("A1:A20")
sourceRange.AutoFill Destination:=fillRange

How can I declare fillRange with a variable inside it ?
For example I can get the number of Rows in a specified column store it in (int x) and I declare it in fillRange so that it stops filling when it gets to that column.

Macro me27 testare extindere
Code:
Copy      Help
int x;
ExcelSheet es.Init
Excel.Application app = es.ws.Application
;/I have another bit in this macro that gets the selection of first row
;x = app.Selection.Rows.Count
Excel.Range sourceRange=es.ws.Range("A1:A1")
;/I want to replace A20 with Ax or something like that
Excel.Range fillRange = es.ws.Range("A20:A20")
sourceRange.AutoFill(fillRange 0)

I hope you understand what I'm trying to do Smile


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)