Update Record or Paste new row - Quickly

ianawwalker

New Member
Joined
Feb 16, 2023
Messages
15
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello,

I have vba code to update records on an individual basis, but am struggling to find or figure out a way to do this on a bulk basis. For instance, I have a data that I've combined into a sheet that I need to update on my "records" sheet if there is a "Y" in a corresponding column. This code below works great if there are only 10 or less records to do, but there is a file of 10-15K items that need to update items on the "records" sheet. Pretty much it needs to review the loan number ranges in each sheet, both column A, find if there is a 0 (not a match, using match formula) in column K, it will replace the field in the "records" sheet with a "Y". Then if it doesn't find the loan number in the "records" sheet, it pastes the whole row to create the new entry. Any help on this is greatly appreciated!

Sheets("Input_Posting").Range("ValueToPost").Copy
Sheets("input_posting").Range("PostingRow").PasteSpecial xlPasteValues
Sheets("Input_Posting").Range("traildocformula").Copy Sheets("input_posting").Range("TrailingDocLocation")
Sheets("Input_Posting").Range("PostingRow").Copy
Sheets("Offline").Select
ActiveSheet.Range("a2").Select
ActiveCell.End(xlDown).Offset(1).Select
ActiveSheet.Paste
Sheets("input_Screen").Select
Range("LoanNum").Select

thank you,

Ian
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
i realized i posted the wrong code, that is just a copy paste i am using. see below.

OfflineRecordCount = Sheets("Offline").Range("a2").End(xlDown).Row - 3
Application.ScreenUpdating = False

For i = 1 To OfflineRecordCount

Sheets("input_posting").Range("OfflineLoanNum") = Sheets("offline").Range("a3").Offset(i)
offlinerecord = Sheets("input_posting").Range("Offlinematch") - 3

If Sheets("input_posting").Range("offlinematch") > 0 Then

Sheets("offline").Range("a3").Offset(i).EntireRow.Copy
'paste
Sheets("records").Select
ActiveSheet.Range("StartSpot").Offset(offlinerecord).Select
ActiveSheet.Paste
Sheets("offline").Range("a3").Offset(i).EntireRow.ClearContents



Else
'copy
Sheets("offline").Range("a3").Offset(i).EntireRow.Copy
'paste
Sheets("Records").Select
ActiveSheet.Range("a3").Select
ActiveCell.End(xlDown).Offset(1).Select
ActiveSheet.Paste
Sheets("offline").Range("a3").Offset(i).EntireRow.ClearContents

End If
Next i
i = 0
MsgBox ("Import Complete")
'clear conents
Sheets("input_Screen").Select
Range("LoanNum").Select

Application.ScreenUpdating = True
 
Upvote 0

Forum statistics

Threads
1,223,984
Messages
6,175,785
Members
452,669
Latest member
reeseann

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top