Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, OssieMac. I'll give it a try. As I replied to tompl, I think you
and he have both given me helpful answers to my question. I really appreciate your help. jcirish "OssieMac" wrote: The problem with your code is enclosing the y in double quotes. Instead of recognizing it as the variable to which the range is assigned, it becomes the string y. Just removing the double quotes and it works. Dim myLastFilledFormulaRow Dim y As Range myLastFilledFormulaRow = 10 'For testing only Range("F" & myLastFilledFormulaRow).Select Set y = Selection Range(y, Range("O20")).FillDown As per your your other reply, there is no need to select the range. The following is the better code. Set y = Range("F" & myLastFilledFormulaRow) Range(y, Range("O20")).FillDown However, you should realize that the above code only fills down. Your range goes across to column O. If you want the entire range to be filled then you need to FillRight also. Set y = Range("F" & myLastFilledFormulaRow) Range(y, Range("O20")).FillDown Range(y, Range("O20")).FillRight -- Regards, OssieMac |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Average: 2nd argument as a variable in another cell av(c6:c(a3)) | Excel Discussion (Misc queries) | |||
Using a variable as an argument | Excel Programming | |||
Function (array argument, range argument, string argument) vba | Excel Programming | |||
Variable as argument in filter range | Excel Programming | |||
type variable as argument of a sub | Excel Programming |