Generate template based on list on another worksheet

alyssaccasey

New Member
Joined
Aug 23, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have a template on one worksheet and a list of names and amounts on another worksheet. I can't figure out a macro to update the name and award cell in the template and save the new template with the new name. Any suggestions? Thanks in advance!!!
 

Attachments

  • Pic2.PNG
    Pic2.PNG
    14.3 KB · Views: 4
  • Pic1.PNG
    Pic1.PNG
    36.2 KB · Views: 5

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try this code :

VBA Code:
Sub Vlookup()

Dim ws As Worksheet

Set ws = ThisWorkbook.Sheets("Template")

With ws
    .Range("P23").Formula = "=VLOOKUP(B4,List!$A:$B,2,0)"
End With


End Sub
 
Upvote 0
Try this code :

VBA Code:
Sub Vlookup()

Dim ws As Worksheet

Set ws = ThisWorkbook.Sheets("Template")

With ws
    .Range("P23").Formula = "=VLOOKUP(B4,List!$A:$B,2,0)"
End With


End Sub
Thanks for the help but it wasn't exactly what I'm looking for. I want the template to fill in with the data from the List worksheet. For example, I want the first one to have 'Sam Smith' in B4 and '$100,000' in P23 and save as File_Sam Smith and then move on to the second line. Does that make sense?
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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