Windows 8 Overwriting Duplicates

Joined
Apr 12, 2015
Messages
1
Reaction score
0
Hello everyone. I have an excel VBA form that i am using to populate data on my spreadsheet. My code for adding is code is below:
Private Sub CMDAdd_details_Click()

Dim emptyRow As Long
Sheet1.Activate

emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1

Cells(emptyRow, 1).Value = TxtName_of_unit.Value
Cells(emptyRow, 2).Value = TXTType_of_audit.Value
Cells(emptyRow, 3).Value = TextDate_of_last_inspection.Value
Cells(emptyRow, 4).Value = TextAssessed_by.Value
Cells(emptyRow, 5).Value = TextFive_Thirty.Value
Cells(emptyRow, 6).Value = TextThirty_Hundred.Value
Cells(emptyRow, 7).Value = TextHundred_Twohundred.Value
Cells(emptyRow, 8).Value = TextTwohundred_Plus.Value

This is populating information just fine, however, i am now getting stuck with duplicates. How can i overwrite Rows that have been previously populated with the latest data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top