LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default How to use a variable as an argument in .FliiDown

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average: 2nd argument as a variable in another cell av(c6:c(a3)) Tony the Tiger Excel Discussion (Misc queries) 2 May 5th 08 12:39 AM
Using a variable as an argument jersiq Excel Programming 3 December 5th 07 12:19 PM
Function (array argument, range argument, string argument) vba Witek[_2_] Excel Programming 3 April 24th 05 03:12 PM
Variable as argument in filter range Bert[_2_] Excel Programming 3 January 21st 05 10:41 PM
type variable as argument of a sub Koos Excel Programming 1 October 23rd 03 11:41 AM


All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"