ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Select a Range of column depending on the date (https://www.excelbanter.com/excel-worksheet-functions/141155-select-range-column-depending-date.html)

Battykoda via OfficeKB.com

Select a Range of column depending on the date
 
Good afternoon to you all.

I have a report build on 12 month, wich every month contain several column.
Ie. August : A to J
September : K to S
etc.
I named all my ranged, but now, i need my macro to select the certain ranged
in relation with the current month.
Funny twist, it's going to be used on french and english computer, so, i
can't name my months in the macro and just used that as my selection. Thats
why i named all my month with the Dirty Dozen names.
Now, i need something that will convert the date a data that i can use as a
reference. Cause, i can't named my fields with only a number... Excel Freaks
out!

i need something like ctxt(monthdate(today)).select an named my field one two
three four, and even that, i'm not sure if it's going to work for french!

Any ideas or questions???

Batty

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


Battykoda via OfficeKB.com

Select a Range of column depending on the date
 
I found my answer.

I named all my range like such :

Dim February As Range
Set February = Range("cn1:cv48")

And then,

A = Month(Date)
Select Case A:
Case Is = 8
August.Select


There you go!!

Batty




Battykoda wrote:
Good afternoon to you all.

I have a report build on 12 month, wich every month contain several column.
Ie. August : A to J
September : K to S
etc.
I named all my ranged, but now, i need my macro to select the certain ranged
in relation with the current month.
Funny twist, it's going to be used on french and english computer, so, i
can't name my months in the macro and just used that as my selection. Thats
why i named all my month with the Dirty Dozen names.
Now, i need something that will convert the date a data that i can use as a
reference. Cause, i can't named my fields with only a number... Excel Freaks
out!

i need something like ctxt(monthdate(today)).select an named my field one two
three four, and even that, i'm not sure if it's going to work for french!

Any ideas or questions???

Batty


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



All times are GMT +1. The time now is 06:34 AM.

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