PDA

View Full Version : Making the date column read left letters from sheet name



April
10-11-2022, 08:51 AM
Hello,

I am trying to find a solution for my issue,
I created a micro that insert date column and fill it, now I need to make the date=activatesheet name but I couldn’t

my code is below

Aprils=activatsheet.name(left,7)

the result coming as “Aprils” instead of the date.

please let me know where is my mistake or the alternative solution.
appreciate the support.

Aussiebear
10-11-2022, 02:01 PM
Your use of Aprils = Activesheet.name is setting the name of the active sheet to "Aprils" so when you use Activesheet.Name(Left,7) it simply returns 7 characters from the left of the sheet name "Aprils" hence the returned value Aprils

georgiboy
11-22-2022, 04:03 AM
Maybe:

Aprils = Left(ActiveSheet.Name, 7)

If you want to make the active sheet name become todays date then maybe:

ActiveSheet.Name = Format(Date, "yyyy.mm.dd")