Select a Range of column depending on the date

  • Thread starter Battykoda via OfficeKB.com
  • Start date
B

Battykoda via OfficeKB.com

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
 
B

Battykoda via OfficeKB.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top