LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Thanks Tom Ogilvy!

Thanks Tom Ogilvy!

I haven't tried this but the "isnumeric" check I think will do the
trick. The if right(cell,1) = "-" didn't help because the headers have
dashes and so it would see the dash and then try to change it to double.

Thanks again!
Anita

Tom Ogilvy wrote:
The check
if right(cell,1)="-" then

should eliminate any problems with headers - cdbl then only looks at cells
containing a "-" as the rightmost character.

cdbl converts this a negative number

? cdbl("231-")
-231

if you having problems, add an isnumeric test

? isnumeric("231-")
True



Dim myRange as Range, Cell as Range
set myRange = Range(Cells(2,10),cells(rows.count,10).End(xlup))
set myRange = myRange.Offset(0,-8).Resize(,9)
for each cell in myRange.SpecialCells(xlConstants,xlTextValues)
if right(cell,1)="-" then
if isnumeric(cell) then
cell.Value = cdbl(cell.value)
end if
end if
Next


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
Resize a cell comotoman Excel Discussion (Misc queries) 1 September 26th 05 04:30 PM
Resize name box Dave Peterson Setting up and Configuration of Excel 0 January 19th 05 01:01 AM
Need some help with Resize. Thanks John Wirt[_2_] Excel Programming 2 July 31st 03 08:37 AM


All times are GMT +1. The time now is 05:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"