Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Almost ready to pull my hair out over this one...
Why can't I get the following code to assign the linkedcell value of an activex combobox????? After running this code the linkedcell value remains blank. Sheets("Row Template").Activate ActiveSheet.ComboBox1.LinkedCell = Range("Offset(insertpoint, -6, 1)") Yet if I change the code following the '=' symbol to a direct reference (as below) it works: Sheets("Row Template").Activate ActiveSheet.ComboBox1.LinkedCell = "A1" Am I using the offset method incorrectly???? How do I do this? Please please help me! --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cornish,
I haven't tried it, but 3 things look wrong. Offset is a property of the Range object , not an argument to range, it on ly has 2 arguments (row and column), and Range must refer to cell(s). Try something like ActiveSheet.ComboBox1.LinkedCell = Range("G1").Offset(insertpoint, -6) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "cornishbloke " wrote in message ... Almost ready to pull my hair out over this one... Why can't I get the following code to assign the linkedcell value of an activex combobox????? After running this code the linkedcell value remains blank. Sheets("Row Template").Activate ActiveSheet.ComboBox1.LinkedCell = Range("Offset(insertpoint, -6, 1)") Yet if I change the code following the '=' symbol to a direct reference (as below) it works: Sheets("Row Template").Activate ActiveSheet.ComboBox1.LinkedCell = "A1" Am I using the offset method incorrectly???? How do I do this? Please please help me! --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob,
I tried your suggestion, adapting it as follows, but when i checked th combobox the value for the linkedcell was blank. ActiveSheet.ComboBox1.LinkedCell = Range("insertpoint").Offset(-6, 1) insertpoint is the named range that I'm trying to offset from to ge the linkedcell reference. Am I missing something -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
We were missing something on the command. It should be
ActiveSheet.ComboBox1.LinkedCell = Range("insertpoint").Offset(-6, 1).Address as the linked cell is not a range, but a range string. The other thing to be aware of is that as soon as you set the linked cell, the combobox is updated with is value (empty?), so it may be best to load it before setting linkedcell With ActiveSheet.ComboBox1 Range("insertpoint").Offset(-6, 1).Value = .Value .LinkedCell = Range("insertpoint").Offset(-6, 1).Address End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "cornishbloke " wrote in message ... Thanks Bob, I tried your suggestion, adapting it as follows, but when i checked the combobox the value for the linkedcell was blank. ActiveSheet.ComboBox1.LinkedCell = Range("insertpoint").Offset(-6, 1) insertpoint is the named range that I'm trying to offset from to get the linkedcell reference. Am I missing something? --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
Once again I owe you my gratitude, thank you very much for your help - that answers a problem I've had for days and it works perfectly. --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As I say, it's a pleasure to help a fellow south-west man.
Regards Bob "cornishbloke " wrote in message ... Bob, Once again I owe you my gratitude, thank you very much for your help - that answers a problem I've had for days and it works perfectly. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is wrong with this code? | Excel Discussion (Misc queries) | |||
What is wrong with the code? | Excel Discussion (Misc queries) | |||
What's wrong with my code ? | Excel Worksheet Functions | |||
What's wrong with this bit of code | Excel Programming | |||
Is something wrong with the code | Excel Programming |