VBA Pulling and updating field from dashboard and overlaying database sheet

ryantttheba

New Member
Joined
Mar 15, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I currently have two worksheets, a database sheet and a "dashboard" sheet that shows selected data given an empty value. I am trying to create VBA code so that when the macro is run, the macro will copy the date from the dashboard into the matching invoice field in the database sheet.

DashboardView
Precondition Invoice Number (Unique Identifier that has been filtered)Invoice Confirmation Date
"Invoice unpaid"2022-34-861To be paid
2022-05-201[User Enters] 03/14/2022

Database View
Invoice NumberInvoice Confirmation NumberOther DataOther DataOther Data
2022-34-861To be confirmed...xx
2022-05-201To be confirmed...xx

So basically - once the user runs the macro - "03/14/2022" will copy and pasted in the invoice number "2022-05-201" in the database.

I have the current code so far and would also like it to loop for all the rows .. can someone please help? Thanks in advance!

Sub Search ()
i=Sheets("DashboardView").Range("c3").Value
m= Application Match(i, Sheets("DatabaseView").Range("B:B"),0)
Sheets("DashboardView").Select
Range("B" & m).Select
Selection.Copy
Sheets("DatabaseView").Select
Range("B" & m).Select
ActiveSheet.Paste
Sheets("DashboardView").Select
Application.CutCopyMode=False
Selection.ClearContents

'Loop
Dim a as integer
for c = 3 to 10
cells (c,[column number]).value=c
next c
end sub

End Sub
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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