I have a workbbok with 13 sheets, one for each month and a summary page. I have used the macro recorder to create a macro that copies cells from the summary page and pastes the values into the cell where the cursor is when I hit the
hot key for the macro.
The recorder produced this code
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Today".Select
Range("A3:G3".Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("July".Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
My problem is that every month I have to change the code to reflect the new month. I would like to write a function which based on the month() function , would return the name of the month, which is how the sheets are named.
I would then call that function from the code above in place of where July now is.
However, I am an extreme novice in Excel. How do I write such a function, where do I place the code, how do I pass a parameter and how do I return the value.Ca I even call a function from within the code above?
I would write the function using a do case, that much I know.
Any help would be appreiated
Thanks in advance
Mike Katz
hot key for the macro.
The recorder produced this code
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Today".Select
Range("A3:G3".Select
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("July".Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
My problem is that every month I have to change the code to reflect the new month. I would like to write a function which based on the month() function , would return the name of the month, which is how the sheets are named.
I would then call that function from the code above in place of where July now is.
However, I am an extreme novice in Excel. How do I write such a function, where do I place the code, how do I pass a parameter and how do I return the value.Ca I even call a function from within the code above?
I would write the function using a do case, that much I know.
Any help would be appreiated
Thanks in advance
Mike Katz