ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   General Loop question (https://www.excelbanter.com/excel-programming/342367-general-loop-question.html)

jhahes[_40_]

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


Tom Ogilvy

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




JE McGimpsey

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



All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com