Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dragos
 
Posts: n/a
Default Macro with a different Header for each Sheet

HELLO,

I have a question for you guys...I have a worksheet with 12 Sheets: A; B; C;
.....K;L.
I would like to record a macro in VBA wich alows me to put in each Sheet a
Header like: Department A for Sheet A, Departement B for Sheet B, etc;
Is this possibile? Please, please help me...I tried all day long !
Thanks
--
Dragos
  #2   Report Post  
Rowan
 
Posts: n/a
Default

Assuming you wanted the header in Cell A1:

Sub NameThem()
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Range("A1").Value = "Department " & Sheets(i).Name
Next i
End Sub

Hope this helps
Rowan

Dragos wrote:
HELLO,

I have a question for you guys...I have a worksheet with 12 Sheets: A; B; C;
....K;L.
I would like to record a macro in VBA wich alows me to put in each Sheet a
Header like: Department A for Sheet A, Departement B for Sheet B, etc;
Is this possibile? Please, please help me...I tried all day long !
Thanks

  #3   Report Post  
Dragos
 
Posts: n/a
Default

Yes, this helps a lot!! it works...Thank you !!! ;-))
--
Dragos


"Rowan" wrote:

Assuming you wanted the header in Cell A1:

Sub NameThem()
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Range("A1").Value = "Department " & Sheets(i).Name
Next i
End Sub

Hope this helps
Rowan

Dragos wrote:
HELLO,

I have a question for you guys...I have a worksheet with 12 Sheets: A; B; C;
....K;L.
I would like to record a macro in VBA wich alows me to put in each Sheet a
Header like: Department A for Sheet A, Departement B for Sheet B, etc;
Is this possibile? Please, please help me...I tried all day long !
Thanks


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
macro for Protecting a Sheet cincode5 Excel Discussion (Misc queries) 5 July 20th 05 11:59 AM
is there anyway in an excel macro to reorder the sheet tabs from left to right? Daniel Excel Worksheet Functions 2 June 23rd 05 07:34 PM
macro to copy columns to sheet Es Excel Discussion (Misc queries) 1 March 7th 05 02:03 PM
MACRO - copy rows based on value in column to another sheet Michael A Excel Discussion (Misc queries) 1 March 5th 05 02:15 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM


All times are GMT +1. The time now is 12:13 PM.

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

About Us

"It's about Microsoft Excel"