Link to home
Start Free TrialLog in
Avatar of leezac
leezac

asked on

Insert value to cell

I need to insert "1" in column C on the Emp_tmp sheet.  Not sure how to do that if someone could help.  I also think the Then last row = 0 is inserting zeros all down the whole sheet.  I do not want that ..  is there a way to take out?  I am not sure what it is doing....Thank you

Dim lastCol As Long, lastRow As Long
Application.ScreenUpdating = False
 
    With Sheets("Emp_tmp")
        lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
        If lastRow = 1 And .Cells(1) = "" Then lastRow = 0
        .Cells(lastRow + 1, "A").PasteSpecial Paste:=xlPasteValues, _
            Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    End With
End If
End Sub
ASKER CERTIFIED SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial