Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Inserting Formula moving down each row

Put formula into col. S as long as same row in col J has something in it.

Range("S2").Select
x = ActiveCell.Row
Do While Cells(x, 10).Value < ""
ActiveCell.FormulaR1C1 = _
"=IF(RC[-9]=""EVT2"",1,IF(RC[-9]=""EVT3"",2,9))"
x = x + 1
Loop

End Sub

Why doesn't this move to the next row?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 185
Default Inserting Formula moving down each row

You are not moving anything, the activecell is not changing (not that it
needs to)

Range("S2").Select
x = ActiveCell.Row
Do While Cells(x, 10).Value < ""
cells(x,19).FormulaR1C1 = _
"=IF(RC[-9]=""EVT2"",1,IF(RC[-9]=""EVT3"",2,9))"
x = x + 1
Loop

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.excelusergroup.org
web: www.nickhodge.co.uk





"iashorty" wrote in message
...
Put formula into col. S as long as same row in col J has something in it.

Range("S2").Select
x = ActiveCell.Row
Do While Cells(x, 10).Value < ""
ActiveCell.FormulaR1C1 = _
"=IF(RC[-9]=""EVT2"",1,IF(RC[-9]=""EVT3"",2,9))"
x = x + 1
Loop

End Sub

Why doesn't this move to the next row?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Inserting Formula moving down each row

You are only incrementing the cell being checked, not the selected
cell.

Cells(2,10).Value
Cells(3,10).Value
Cells(4,10).Value

etc

HTH,
JP

On May 21, 4:02*pm, iashorty
wrote:
Put formula into col. S as long as same row in col J has something in it.

Range("S2").Select
* * x = ActiveCell.Row
* * Do While Cells(x, 10).Value < ""
* * * * ActiveCell.FormulaR1C1 = _
* * * * * * "=IF(RC[-9]=""EVT2"",1,IF(RC[-9]=""EVT3"",2,9))"
* * * * x = x + 1
* * Loop

End Sub

Why doesn't this move to the next row?


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
how do i keep images from moving when inserting rows in Excel? isaac_klemish Excel Discussion (Misc queries) 1 March 3rd 09 08:27 PM
Moving Formula fak119 Excel Discussion (Misc queries) 0 April 27th 06 08:06 AM
moving a formula Crawford Excel Discussion (Misc queries) 3 April 13th 06 04:29 PM
Moving the formula bar J Cole Excel Discussion (Misc queries) 1 June 15th 05 02:51 PM
Inserting specific data into moving cells Max Velocity[_4_] Excel Programming 2 November 28th 03 08:16 AM


All times are GMT +1. The time now is 07:27 PM.

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"