ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheets reference change variable (https://www.excelbanter.com/excel-programming/364359-sheets-reference-change-variable.html)

Francois via OfficeKB.com

Sheets reference change variable
 
Is it possible to have the sheets reference read the contents of a cell eg
Sheets(A1) where A1 contains JUN06 and would change if I altered A1 to
JUL06 ?

Sheets("JUN06").Range("E5:AO10000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("E1:F2"), CopyToRange:=Range("C6:AJ6"), Unique:
=False
rows("6:6").Copy

rest of macro etc

--
Message posted via http://www.officekb.com

[email protected]

Sheets reference change variable
 
something like

sheets(range("A1").value).range....

would be what you want I think

Francois via OfficeKB.com wrote:
Is it possible to have the sheets reference read the contents of a cell eg
Sheets(A1) where A1 contains JUN06 and would change if I altered A1 to
JUL06 ?

Sheets("JUN06").Range("E5:AO10000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("E1:F2"), CopyToRange:=Range("C6:AJ6"), Unique:
=False
rows("6:6").Copy

rest of macro etc

--
Message posted via http://www.officekb.com



Francois via OfficeKB.com

Sheets reference change variable
 
wrote:
something like

sheets(range("A1").value).range....

would be what you want I think

Is it possible to have the sheets reference read the contents of a cell eg
Sheets(A1) where A1 contains JUN06 and would change if I altered A1 to

[quoted text clipped - 6 lines]

rest of macro etc



I'll give it a try.

Thanks for the info

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200606/1

Francois via OfficeKB.com

Sheets reference change variable
 
wrote:
something like

sheets(range("A1").value).range....

would be what you want I think

Is it possible to have the sheets reference read the contents of a cell eg
Sheets(A1) where A1 contains JUN06 and would change if I altered A1 to

[quoted text clipped - 6 lines]

rest of macro etc



Wonderful, Thanks again

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200606/1


All times are GMT +1. The time now is 09:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com