ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .ControlSource (https://www.excelbanter.com/excel-programming/357220-controlsource.html)

Ctech[_128_]

.ControlSource
 

I have this bit of code in a macro

With C5B_UserForm.ComboBox1
RowSource = mSource
ControlSource = Worksheets("Template").Range("X4")
End With

However Im getting an '3802 error on the ControlSource bit, anyone know
why?


--
Ctech


------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=526689


Martin

.ControlSource
 
You're giving it an Excel range but it's expecting a string that contains the
address of the range. Just stick .Address on the end.

"Ctech" wrote:


I have this bit of code in a macro

With C5B_UserForm.ComboBox1
.RowSource = mSource
.ControlSource = Worksheets("Template").Range("X4")
End With

However Im getting an '3802 error on the ControlSource bit, anyone know
why?


--
Ctech


------------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=526689




All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com