Forum

Could not assign a ...
 
Notifications
Clear all

Could not assign a value of defined name to a cell?

3 Posts
2 Users
0 Reactions
75 Views
(@julian)
Posts: 82
Estimable Member
Topic starter
 

I've a defined name "upperbound" referring to "=COUNTA(IdList[Path]) " to count the number of rows in the column "IdList[Path]", Then I tried to assign the value of "upperbound" to cell A1 using the VBA code as follows:

Sub test()
Range("A1").Value = upperbound
End Sub
 
unfortunately it didn't work as I expected. How should I fix it? Thanks.
 
 
 
 
Posted : 16/10/2017 3:57 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Julian

Maybe you can give this a try.

Range("A1") = Application.Evaluate("upperbound")

Sunny

 
Posted : 16/10/2017 9:19 pm
(@julian)
Posts: 82
Estimable Member
Topic starter
 

Hi Sunny,

Yes, it solved my problem. Thank you again.

Julian

 
Posted : 18/10/2017 5:20 am
Share: