![]() |
#1
|
||||
|
||||
![]()
I'm not sure how to entitle this thread, nor how to google for the answer. I don't use names much in Excel, but I have a situation where it seems useful and I want my program to use it too.
Now, a name can refer either to a range (eg Market!C8) or to a value (2100). I see in VBA that I can get my program to use the range just fine, for example Code:
Set ro = ThisWorkbook.Names("cFuel").Range In my worksheet, for example, one formula refers to "RC5*RpPK". It works fine, multiplying the value in col 5 by 0.45 and displaying the numeric I want. But in my VBA program, when I refer to Names("RpPK").Value, I get back a string "=.045". When I try adding 1 to it, I don't get 1.45, I get an error. I've tried various combinations, but all I get back is the string, not the value. Now, this doesn't have to be a deal-breaker; I can always strip off the leading "=" and use a conversion function. But it seems silly; surely Excel has some method or property that just issues the numeric value rather than a string value. The worksheet has access to the numeric value; why wouldn't VBA? Anyone know how to do this? |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
omahadivision | Excel Programming | 12 | 11-23-2013 12:10 PM |
Replace contents form 1 workbook with another based on simular data | shabbaranks | Excel | 1 | 12-05-2012 11:11 PM |
![]() |
virsojour | Excel Programming | 5 | 02-01-2011 08:58 PM |
inserting a string of data into an MS Word table??? | matto | Word VBA | 0 | 07-16-2010 09:35 AM |
![]() |
nolesca | Excel | 4 | 06-07-2010 08:13 AM |