Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default General Loop question


Can someone please help me with the following!

I just want to do this

Start in Cell b2

activecell.offset(0,5).value = cdbl(Activecell.value)

then go to b3
b4
b5


all the way until row 500.

I am trying to convert these text strings to number format without
retyping them.

Thanks
Josh


--
jhahes
------------------------------------------------------------------------
jhahes's Profile: http://www.excelforum.com/member.php...o&userid=23596
View this thread: http://www.excelforum.com/showthread...hreadid=474780

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default General Loop question

Sub convertStrings()
Dim cell as Range
for each cell in Range("B2:B50")
if isnumeric(cell.value) then
cell.offset(0,5).Value = cdbl(cell.value)
end if
next
End sub

--
Regards,
Tom Ogilvy

"jhahes" wrote in
message ...

Can someone please help me with the following!

I just want to do this

Start in Cell b2

activecell.offset(0,5).value = cdbl(Activecell.value)

then go to b3
b4
b5


all the way until row 500.

I am trying to convert these text strings to number format without
retyping them.

Thanks
Josh


--
jhahes
------------------------------------------------------------------------
jhahes's Profile:

http://www.excelforum.com/member.php...o&userid=23596
View this thread: http://www.excelforum.com/showthread...hreadid=474780



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default General Loop question

One way:

With Range("B2:B500")
.Offset(0, 5).Value = .Value
Cells(Rows.Count, Columns.Count).Copy 'assume empty cell
.Offset(0, 5).PasteSpecial Paste:=xlPasteValues, _
Operation:=xlPasteSpecialOperationAdd
End With


In article ,
jhahes wrote:

Can someone please help me with the following!

I just want to do this

Start in Cell b2

activecell.offset(0,5).value = cdbl(Activecell.value)

then go to b3
b4
b5


all the way until row 500.

I am trying to convert these text strings to number format without
retyping them.

Thanks
Josh

Reply
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
General Question Jared Jenner Excel Discussion (Misc queries) 1 July 18th 06 08:14 PM
General Question Me Excel Discussion (Misc queries) 3 January 12th 06 12:55 PM
General Question Easydoesit Excel Worksheet Functions 1 June 19th 05 07:14 AM
General question David Excel Programming 1 February 4th 04 10:01 AM
General Question Squid[_2_] Excel Programming 3 January 12th 04 07:25 PM


All times are GMT +1. The time now is 03:11 AM.

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

About Us

"It's about Microsoft Excel"