Using VBA to Conditionally Overwrite Multiple Cells Based on Dropdown

keithmcvean

New Member
Joined
Dec 20, 2013
Messages
13
I have a spreadsheet (G4:T1000) with a dropdown list in column G. What I'm trying to do, using VBA, is to lookup the value of G in a table (ProgramTemplate) and fill in the columns H:T for that row based on that table.

I could do this with a simple VLOOKUP but I need the ability to have the users overwrite the data in columns H:T should they choose the value "custom" in column G.

Ideally, if the user decided for some reason to choose custom and then decided again that they instead wanted a different value in G, the custom data they entered would be overwritten with the values from the table.

I can figure out how to do this every time the value in the sheet changes but I was hoping for something more row by row for efficiency sake if nothing else.
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
In the worksheet code you can add this when you change the value in col G:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If ActiveCell.Column = 7 Then
    MsgBox "update H thru T values", , "col 7 change"
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,755
Members
449,187
Latest member
hermansoa

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