minkthemonk
New Member
- Joined
- Oct 11, 2017
- Messages
- 2
Hello everyone!
I'm trying to automate the copy process of a certain Sheet to another Sheet in order to create a sum up of a day in my company.
So:
I have a workbook with 32 Sheets.
31 Sheets for each day of the month.
1 Sheet that works as a "template" to sum up the data of each day.
All 31 Sheets have the name of the respctive day of the month (1,2,3...31)
The last Sheet, called Fecho represents the "template" where I want the data to be copied in order to Print it after.
I want to copy some cell contents (the result of various calculations) to specific cells is the Sheet "Fecho".
This is very simple to do, but I'm trying to make only one macro instead of 31. (1 macro for each Sheet)
Basically I need to change the Sheet "1" or "17" whatever to "current sheet" (?) Or am I saying something really stupid?
Can you please explain me how to do it?
Here's my code for sheet "1" :
Sub GerarFC()
'
' GerarFC Macro
'
'
Range("C7:F12").Select
Selection.Copy
Sheets("Fecho").Select
Range("B2:E7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("B26:H26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("A12:G12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("I26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("B15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("K26:M26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("C15:E15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("K23:L23").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("G25:H25").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
Thank you very much.
Best regards,
I'm trying to automate the copy process of a certain Sheet to another Sheet in order to create a sum up of a day in my company.
So:
I have a workbook with 32 Sheets.
31 Sheets for each day of the month.
1 Sheet that works as a "template" to sum up the data of each day.
All 31 Sheets have the name of the respctive day of the month (1,2,3...31)
The last Sheet, called Fecho represents the "template" where I want the data to be copied in order to Print it after.
I want to copy some cell contents (the result of various calculations) to specific cells is the Sheet "Fecho".
This is very simple to do, but I'm trying to make only one macro instead of 31. (1 macro for each Sheet)
Basically I need to change the Sheet "1" or "17" whatever to "current sheet" (?) Or am I saying something really stupid?
Can you please explain me how to do it?
Here's my code for sheet "1" :
Sub GerarFC()
'
' GerarFC Macro
'
'
Range("C7:F12").Select
Selection.Copy
Sheets("Fecho").Select
Range("B2:E7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("B26:H26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("A12:G12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("I26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("B15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("K26:M26").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("C15:E15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("1").Select
Range("K23:L23").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Fecho").Select
Range("G25:H25").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
Thank you very much.
Best regards,