lookup value and insert said value into textbox

aheverett1

New Member
Joined
May 23, 2017
Messages
16
Hello all,

I'm sure this is an extremely easy fix for a seasoned excel pro but i just can't find the answer. Here is the code i have in another function and it works just fine for copying data into cells.

'copy Fixture Locations, Quantity, and Ceiling Height
Worksheets(Worksheets("Electrical Options").Range("B9").Value).Range("A6:C46").Copy
Worksheets("Fixture Selections").Range("A10").PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlPasteSpecialOperationNone, _
SkipBlanks:=False, _
Transpose:=False

Now i want to pretty much use the same code but put the value into a activex textbox using a command button. I would be removing the range "A6:C46" and just making it one cell range, say "A8".

Thank you for the help!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hello aheverett1,

Here is an example of copying the value from "Sheet2 A8" to the AcctiveX TextBox on "Sheet1". You may need to change the worksheet names and the TextBox name to match your workbook names.
Code:
        With Worksheets("Sheet1").OLEObjects("TextBox1").Object
            .Value = Worksheets("Sheet2").Range("A8").Value
        End With
 
Upvote 0
Thank you!I The final code ended up like this but worked out perfectly.

With Worksheets("Fixture Selections").OLEObjects("TextBox2").Object
.Value = Worksheets(Worksheets("Electrical Options").Range("B9").Value).Range("O1").Value
End With
 
Upvote 0
Hello aheverett1,

It is nice to see you were able to adapt my example so easily. Glad I could help.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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