Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default identify active sheet

I am trying to identify my currently active sheet name.

If sheets(ActiveSheet) = sheets("first sheet") Then
a=1
ElseIf sheets(ActiveSheet) = sheets("second sheet") Then
a=2
End If

this does not work. I have tried many variations of the first line, but no
luck. any ideas? thx


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default identify active sheet

This should help:

sub Check()
MsgBox ActiveSheet.Name
MsgBox Sheets(1).Name
end sub


"mike allen" wrote in message
...
I am trying to identify my currently active sheet name.

If sheets(ActiveSheet) = sheets("first sheet") Then
a=1
ElseIf sheets(ActiveSheet) = sheets("second sheet") Then
a=2
End If

this does not work. I have tried many variations of the first line, but
no luck. any ideas? thx



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to identify active worksheet in macro MLK Excel Worksheet Functions 1 March 13th 07 04:29 PM
How to identify active Menu Bars Matz Excel Discussion (Misc queries) 3 August 6th 06 08:21 PM
Active Cell Copy And Paste Sheet to Sheet A.R.J Allan Jefferys New Users to Excel 4 May 4th 06 02:04 AM
VBA code to identify last row in a sheet SharonP. Excel Discussion (Misc queries) 4 February 17th 06 02:15 PM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"