10-07-2013, 08:35 AM
Set sourceRange = Worksheets("Sheet1").Range("A1:A2")
Set fillRange = Worksheets("Sheet1").Range("A1:A20")
sourceRange.AutoFill Destination:=fillRangeHow 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
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
