PDA

View Full Version : VBA Copy/Paste Data Based Off ActiveX Dropdown Box



Tmod
11-21-2016, 01:17 PM
Hi,

I am trying to get my idea to work but I have tried several recommendations off various forums with no luck. Hopefully someone can give me a helping hand here.

What I am trying to do is copy data from "Fluids" and paste it to "Plots" based off dropdown box selection. I have used Listfillrange to populate the dropdown box based off data in "Fluids".

My goal here is to copy the data From "Fluids" cells B3,C3,D3 paste to "Plots" F10,G10,H10 / "Fluids" cells E3,F3 paste to "Plots" E13,F13 if user selected 'Spectro Ultra Light' from dropdown box.

I am attaching the sheet here so you can actually see what I am trying to do.

Thanks in advance for any assistance anyone might be able to offer.

Terry

Kenneth Hobs
11-21-2016, 03:19 PM
Welcome to the forum!

Right click the sheet, View Code, and paste.

Private Sub ComboBox1_Change()
Dim f As Range
Application.EnableEvents = False
On Error Resume Next
With Worksheets("Fluids")
Set f = .Columns("A").Find(ComboBox1.Value)
If f Is Nothing Then Exit Sub
.Range(.Cells(f.Row, "B"), .Cells(f.Row, "D")).Copy Range("F10")
.Cells(f.Row, "E").Copy Range("E13")
.Cells(f.Row, "F").Copy Range("F13")
End With
Application.EnableEvents = True
End Sub

Tmod
11-22-2016, 09:46 PM
Hi Kenneth,

Thanks for the coding and the time you took to write it, It works like a dream.

Terry