Lenny Enfield
New Member
- Joined
- Jan 6, 2012
- Messages
- 2
Hello,
I am trying to create a macro to run in a document that contains many sheets. There is one sheet at the beginning, and then subsequent sheets which all have a calendar month in the title.
What I want the macro to do is recognise which 'month' it is in a paste a value into its respective cell on the first sheet.
My macro at the moment is:
Sub Macro1()
Range("D4").Select
Selection.End(xlDown).Select
Selection.Copy
If ActiveSheet.Name = ("IR_25th November 11") Then
Sheets("Sheet1").Select
Range("L3").Select
End If
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
So at the moment when I run macro in the "IR_25th November 11" sheet it copies the piece of data I need into the correct cell on the front page. What I would like it to do is to run just as long the worksheet has the word November in the title. Is this possible?
Please let me know if any clarification is required as I don't think I have explained this very well!
I am trying to create a macro to run in a document that contains many sheets. There is one sheet at the beginning, and then subsequent sheets which all have a calendar month in the title.
What I want the macro to do is recognise which 'month' it is in a paste a value into its respective cell on the first sheet.
My macro at the moment is:
Sub Macro1()
Range("D4").Select
Selection.End(xlDown).Select
Selection.Copy
If ActiveSheet.Name = ("IR_25th November 11") Then
Sheets("Sheet1").Select
Range("L3").Select
End If
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
So at the moment when I run macro in the "IR_25th November 11" sheet it copies the piece of data I need into the correct cell on the front page. What I would like it to do is to run just as long the worksheet has the word November in the title. Is this possible?
Please let me know if any clarification is required as I don't think I have explained this very well!