ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Cell equals "XXX" Then...... (https://www.excelbanter.com/excel-programming/371282-if-cell-equals-xxx-then.html)

Benz

If Cell equals "XXX" Then......
 
I am trying to create a macro that if Cell "B15" which is formated as
"mm/dd/yyyy" = "June/dd/yyyy" then Sheets("June").Select and so on for each
month. I know a longer way of accomplishing this but was just wondering how
to do it without all the code.

Thank you to anyone who helps and all you wonderful people out there that
make this discussion group so valuable by sharing all your knowledge!



Tom Ogilvy

If Cell equals "XXX" Then......
 

if not isdate(activecell) then exit sub
worksheets(format(Activecell.Value,"mmmm")).Select


--
regards,
Tom Ogilvy


"Benz" wrote:

I am trying to create a macro that if Cell "B15" which is formated as
"mm/dd/yyyy" = "June/dd/yyyy" then Sheets("June").Select and so on for each
month. I know a longer way of accomplishing this but was just wondering how
to do it without all the code.

Thank you to anyone who helps and all you wonderful people out there that
make this discussion group so valuable by sharing all your knowledge!



Benz

If Cell equals "XXX" Then......
 
It works wonderful, Thanks Again Tom!

"Tom Ogilvy" wrote:


if not isdate(activecell) then exit sub
worksheets(format(Activecell.Value,"mmmm")).Select


--
regards,
Tom Ogilvy


"Benz" wrote:

I am trying to create a macro that if Cell "B15" which is formated as
"mm/dd/yyyy" = "June/dd/yyyy" then Sheets("June").Select and so on for each
month. I know a longer way of accomplishing this but was just wondering how
to do it without all the code.

Thank you to anyone who helps and all you wonderful people out there that
make this discussion group so valuable by sharing all your knowledge!




All times are GMT +1. The time now is 02:16 AM.

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