Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing worksheet
How do you get this formula to work when the worksheet is not active. i want
the macro pull the formula down but i don't want the user to see the worksheet that this is all happening on. Range("f2", Range("a2").End(xlDown)).Offset(0, 5).FillDown -- Thank you, Jennifer |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing worksheet
Something like:
With Worksheets("Sheet1") .Range("f2", .Range("a2").End(xlDown)).Offset(0, 5).FillDown End with Make sure you put periods in front of all Range and Cell properties, as shown above. I normally do a little more work programming, and use object variables, to make single-stepping (and therefore debugging) easier (untested): Dim wsSheet1 as Worksheet Dim rngA2Data as Range Dim rngFillRange as Range Set wsSheet1 = Worksheets("Sheet1") With wsSheet1 Set rngA2Data = .Range("A2").End(xlDown) Set rngFillRange = .Range("F2").Resize(rngA2Data.Rows.Count) End With rngFillRange.FillDown FYI: You might check out some of the Excel MVP web sites for more help. http://www.mvps.org/links.html#Excel -- Regards, Bill Renaud |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing worksheet
Thank you. Like you thought i was trying it the way you wrote it but was
forgetting the periods and it wouldn't work. Ha. Thanks. -- Thank you, Jennifer "Bill Renaud" wrote: Something like: With Worksheets("Sheet1") .Range("f2", .Range("a2").End(xlDown)).Offset(0, 5).FillDown End with Make sure you put periods in front of all Range and Cell properties, as shown above. I normally do a little more work programming, and use object variables, to make single-stepping (and therefore debugging) easier (untested): Dim wsSheet1 as Worksheet Dim rngA2Data as Range Dim rngFillRange as Range Set wsSheet1 = Worksheets("Sheet1") With wsSheet1 Set rngA2Data = .Range("A2").End(xlDown) Set rngFillRange = .Range("F2").Resize(rngA2Data.Rows.Count) End With rngFillRange.FillDown FYI: You might check out some of the Excel MVP web sites for more help. http://www.mvps.org/links.html#Excel -- Regards, Bill Renaud |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Referencing a value on a different worksheet | Excel Discussion (Misc queries) | |||
Referencing a Worksheet | Excel Discussion (Misc queries) | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
referencing another worksheet | Excel Worksheet Functions |