troubleshooting Question

Insert value to cell

Avatar of leezac
leezac asked on
Microsoft Excel
1 Comment1 Solution345 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros