View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Copy Sheet Names to a Column

Wester

Worksheets("Sheet1").Activate

But bear in mind in most cases to work on a sheet you don't need to select
it, I always assign a variable to it first to stop having to use the full
qualifier each time. This is also safer to ensure your code works in the
correct range. (By default it also ensures you get an intellisense list of
objects and methods, which is handy

So

Sub test()
Dim wks As Worksheet
Set wks = Worksheets("Sheet3")
With wks
.Range("A1").Value = "Nick did this"
.Columns(1).AutoFit
.Name = "Nicks Sheet"
.PageSetup.LeftFooter = "My Left Foot"
End With
End Sub

Does all you want without selecting or activating. (Any selection or
activation takes time and needs you to stop the screen flashing with
application.screenupdating=false)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"Wester" wrote in message
...
Disregard 1st question, I found the solution in another post.

New question and pretty simple one (but not for me... Krikee). How do I
jump to or select a specific sheet in my workbook so my macro will always
run
on that one sheet.

Sheets("Code Master").Activate
Sheets("Code Master").Select

Any help would be appreciated.

Thanks!

-Wesley


"Wester" wrote:

Hi,

Struggling with the command/macro to copy all sheet names in my workbook
to
single column on a 'master' sheet.

Any help would be apprecieted.

-Wesley