LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Macro - Using a variable number of columns in a Range

I have a range of cells that I need to Autofill, however, the number of rows
changes on an irregular basis based on a different set of information.
Therefore, I need to somehow incorporate this in a macro...

In one cell I have the "CountA" formula to count the number of cells of a
particular type of information in a certain data set. This number will need
to be used in a macro to limit the number of rows the autofill will select
with a different dataset.

so something along the lines of:

Range("B4:P4").Select
Selection.AutoFill Destination:=Range("B4:P(Sommaire!C10)"),
Type:=xlFillDefault
Range("B4:P(Sommaire!C10)").Select

The (Sommaire!C10) is where the value of the CountA formula is found.

I hope I made this clear enough,


Chris
 
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
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Range used in a macro needs to be variable DaveP Excel Worksheet Functions 3 November 4th 05 03:23 PM
Resize Range - Macro Danny Excel Worksheet Functions 11 October 22nd 05 12:37 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Chart based on variable number of columns Scott Hamilton Charts and Charting in Excel 2 June 5th 05 03:36 PM


All times are GMT +1. The time now is 01:45 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"