LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using a variable as an argument

I have a spreadsheet where I am auto-filtering the data, creating new sheets
based on the filters, then graphing the results.
The row length of my data can be variable, and in my macro, I want to be
able to paste the variable length of the data to one of the new sheets.

For example, on the "raw data" page, I filter two criteria and copy the
column with data I need to another worksheet.
Earlier in the macro I do define the row length, using an "IF" statement
combined with a "SUM" statement, and assign it to the variable row_count.
Now later in the macro, I would like to call that variable into my paste
function.

Selection.AutoFilter Field:=4, Criteria1:="1"
Selection.AutoFilter Field:=3, Criteria1:="1"
Range("G2:G(I WANT MY VARIABLE HERE)").Select

The above of course, gives me errors.

Now later in the macro, which I haven't written yet, I will also need to
call this variable, as it will determine the source data for a chart plotted
over time.

Is the way I am attempting this going to cause problems with the chart in
the fuiture?
 
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
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
passing a variable as an argument to a function Drew[_6_] Excel Programming 3 July 25th 03 08:51 PM


All times are GMT +1. The time now is 02:58 AM.

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"