Thread: VBA Problems
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default VBA Problems

try this
Sheets("201").Copy after:=Sheets(Sheets.Count)

"Elise148" wrote:

I'm trying to copy a worksheet and move and rename it to the end of the
workbook. This is the VBA code I have...

Sheets("201").Select
N = Sheets.Count
Sheets("201").Copy After:=Sheets(N)
ActiveSheet.Name = InputBox("Enter the number of the new distributor.")

It works for several times, but then an error comes up and it highlights the
third row. I don't understand! Any ideas?!?!?