Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default dim statements for worksheets array

I am creating a macro in visual basic 6 for excel .I came across some code in
vb help to fill across sheets, eg.
x = Array("Sheet1", "Sheet5", sheet7")
Sheet(x).FillAcrossSheets _
Worksheets("Sheet1").Range("A1:C5")
But I am having trouble dimentioning the above code. Any suggestions please.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default dim statements for worksheets array

Try

Dim X As Variant
X = Array("Sheet1", "Sheet5", "sheet7")
Sheets(X).FillAcrossSheets _
Worksheets("Sheet1").Range("A1:C5")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"RichardVisteon" wrote
in message
...
I am creating a macro in visual basic 6 for excel .I came across
some code in
vb help to fill across sheets, eg.
x = Array("Sheet1", "Sheet5", sheet7")
Sheet(x).FillAcrossSheets _
Worksheets("Sheet1").Range("A1:C5")
But I am having trouble dimentioning the above code. Any
suggestions please.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default dim statements for worksheets array

Your issue was my issue...thx for the help, however, another question off of
this....

I have this code/macro saved in my personal macro wkbk, but how can I make
it work in a wkbk with same exact structure, different file and tab names?
Is there some sort of "currentwkbk" property or command I can use in the
code, instead of the specific sheet names?

"RichardVisteon" wrote:

I am creating a macro in visual basic 6 for excel .I came across some code in
vb help to fill across sheets, eg.
x = Array("Sheet1", "Sheet5", sheet7")
Sheet(x).FillAcrossSheets _
Worksheets("Sheet1").Range("A1:C5")
But I am having trouble dimentioning the above code. Any suggestions please.

Reply
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
Array formula with and/or statements Matthew[_2_] Excel Discussion (Misc queries) 4 May 15th 10 03:19 PM
& combine two array statements Paul Moles Excel Worksheet Functions 3 December 9th 09 11:24 AM
If(and statements using data in an array Lou H Excel Discussion (Misc queries) 5 August 25th 08 02:30 PM
IF statements across Worksheets rgold Excel Worksheet Functions 2 April 18th 07 10:18 PM
Convert repetitive IF statements to array loop? bntringa[_4_] Excel Programming 5 January 27th 06 09:45 PM


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

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

About Us

"It's about Microsoft Excel"