Textbox populate

melewie

Board Regular
Joined
Nov 21, 2008
Messages
188
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have a textbox (active x) on a worksheet I want this to be populate by a range (Country_RNG) when the workbook opens

Code:
Private Sub Workbook_Open()
Sheets("Front Page").Select
Country_CBX.List = Range("Country_RNG").Value

End Sub

This is on the 'This worksheet' object. Im getting runtime error 424. Any help would be great.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Code:
Private Sub Workbook_Open()
Sheets("Front Page").Select
[B][COLOR=Red]Sheets("Front Page").[/COLOR][/B]Country_CBX.List = Range("Country_RNG").Value
End Sub

and the code should probably be on the 'ThisWorkbook' object
 
Last edited:
Upvote 0
Code:
Private Sub Workbook_Open()
Sheets("Front Page").Select
[B][COLOR=red]Sheets("Front Page").[/COLOR][/B]Country_CBX.List = Range("Country_RNG").Value
End Sub


I am a plank!!!!!!

Thanks for that bobsan!
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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