courtlandre
New Member
- Joined
- Feb 27, 2008
- Messages
- 31
I use the following macro to look at a row, take info from that row, switch sheets, enter the info, copy something, switch back to the original sheet and enter the info. It does this for every row on the sheet.
I want to be able to use this macro for all sheets in the workbook. "Dashboard" is used by all sheets. but how do I get "CUT" to be dynamic and have the macro figure out which sheet it started with?
In other words, I need a macro that when ran, determines which sheet it was ran from and set that as a value that can be used.
Thanks for any help!
Code:
Sub GetSS()
Application.ScreenUpdating = False
BeginRow = 9
Endrow = 80
ChkCol = 3
GrabCol = 2
PutCol = 12
For RowCnt = Endrow To BeginRow Step -1
If Cells(RowCnt, ChkCol).Value = "*" Then
Cells(RowCnt, GrabCol).Copy
Sheets("Dashboard").Select
Cells(7, 3).Select
ActiveSheet.Paste
Cells(24, 5).Copy
Sheets("CUT").Select
Cells(RowCnt, PutCol).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End If
Next RowCnt
End Sub
I want to be able to use this macro for all sheets in the workbook. "Dashboard" is used by all sheets. but how do I get "CUT" to be dynamic and have the macro figure out which sheet it started with?
In other words, I need a macro that when ran, determines which sheet it was ran from and set that as a value that can be used.
Thanks for any help!