View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
MarkT MarkT is offline
external usenet poster
 
Posts: 67
Default Visual Basic - Variable Sheet Names

Hi Everyone,

I have a macro that I run on a 2007 workbook that makes a duplicate copy of
the current sheet by hitting a button with the macro associated with it. The
macro runs fine when the sheet is named "Sheet1"; however, once a duplicate
sheet has been created, I need to change the name of that sheet, then when I
go and hit my macro button again, I get an error since I have now renamed
"Sheet1" to something else.

In VB, is there a term that I may use to duplicate the current sheet
selected? I need to have a variable term used instead of the current
"sheet1" that is in my macro.

Thanks for your help as always!

Mark