Hello,
Is it possible to have macro copy one column and paste the value to the next empty column in the same sheet? Please note the existing "new draw" macro copies all values in the Total columns and paste values to Prior columns and clears contents of Current columns. This addition to the code would have to occur prior to the clearing of the current values. Below is existing code and were I assume the additional code should be inserted.
Thanks in advance for your suggestions.
Dim Res As VbMsgBoxResult
Res = MsgBox("CANNOT UNDO: Ready to clear current amounts and combine with prior totals?", vbYesNo)
If Res = vbYes Then
' comment on action user will take-- user clicks yes and macro proceeds, user clicks no it stops
Else
Exit Sub
End If
Sheet2.Unprotect
ASSUMING THIS IS WHERE THE ADDITIONAL CODE TO COPY/PASTE VALUES TO NEXT EMPTY COLUMN WOULD BE. I WOULD LIKE IT TO START PASTING IN COLUMN "AA" AND WORK ITS WAY TO THE RIGHT WITH EACH ENTRY
For Each c In Range("e11:e234")
If c.Interior.Color = RGB(255, 255, 185) Then
c.Offset(0, -1).Value = c.Offset(0, -1).Value + c.Value
c.ClearContents
End If
Next c
For Each c In Range("i11:i234")
If c.Interior.Color = RGB(255, 255, 185) Then
c.Offset(0, -1).Value = c.Offset(0, -1).Value + c.Value
c.ClearContents
End If
Next c
For Each c In Range("l11:l234")
If c.Interior.Color = RGB(255, 255, 185) Then
c.Offset(0, -1).Value = c.Offset(0, -1).Value + c.Value
c.ClearContents
End If
Next c
For Each c In Range("b6:b7")
c.ClearContents
Next c
Sheet2.Protect , AllowFormattingColumns:=True, AllowFormattingRows:=True
Application.ScreenUpdating = True
MsgBox "All Current amounts have been added to Prior amounts"
'Sheet2.Range("A1").Value = Sheet2.Range("A1").Value + Sheet2.Range("B1").Value
End Sub
Is it possible to have macro copy one column and paste the value to the next empty column in the same sheet? Please note the existing "new draw" macro copies all values in the Total columns and paste values to Prior columns and clears contents of Current columns. This addition to the code would have to occur prior to the clearing of the current values. Below is existing code and were I assume the additional code should be inserted.
Thanks in advance for your suggestions.
Dim Res As VbMsgBoxResult
Res = MsgBox("CANNOT UNDO: Ready to clear current amounts and combine with prior totals?", vbYesNo)
If Res = vbYes Then
' comment on action user will take-- user clicks yes and macro proceeds, user clicks no it stops
Else
Exit Sub
End If
Sheet2.Unprotect
ASSUMING THIS IS WHERE THE ADDITIONAL CODE TO COPY/PASTE VALUES TO NEXT EMPTY COLUMN WOULD BE. I WOULD LIKE IT TO START PASTING IN COLUMN "AA" AND WORK ITS WAY TO THE RIGHT WITH EACH ENTRY
For Each c In Range("e11:e234")
If c.Interior.Color = RGB(255, 255, 185) Then
c.Offset(0, -1).Value = c.Offset(0, -1).Value + c.Value
c.ClearContents
End If
Next c
For Each c In Range("i11:i234")
If c.Interior.Color = RGB(255, 255, 185) Then
c.Offset(0, -1).Value = c.Offset(0, -1).Value + c.Value
c.ClearContents
End If
Next c
For Each c In Range("l11:l234")
If c.Interior.Color = RGB(255, 255, 185) Then
c.Offset(0, -1).Value = c.Offset(0, -1).Value + c.Value
c.ClearContents
End If
Next c
For Each c In Range("b6:b7")
c.ClearContents
Next c
Sheet2.Protect , AllowFormattingColumns:=True, AllowFormattingRows:=True
Application.ScreenUpdating = True
MsgBox "All Current amounts have been added to Prior amounts"
'Sheet2.Range("A1").Value = Sheet2.Range("A1").Value + Sheet2.Range("B1").Value
End Sub