Thread: [Solved] deleting blanks and commas
View Single Post
 
Old 03-01-2017, 11:33 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

There is only ever one active cell at a time in Excel and it is always on the active sheet so have to make sure sheet 1 is the active sheet to use this
Code:
' copy back to sheet 1

With Sheets("Sheet1")
    .Activate           '<~~ makes sure right sheet is active
    .Rows(ActiveCell.Row).Insert Shift:=xlDown
    Sheets("Sheet2").Range("A3:Z3").Copy .Range("A" & ActiveCell.Row)
End With
Won't be back 'til morning.
Reply With Quote