LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem incrementing rows

i = 112
For Each row In Rows("1:267")
cn t = 0
For Each cell In row.Columns("A:D")
If cell.Value = "PACK" Then
cell.Value = "PACK" & CStr(i)
cnt = cnt 1
End If
Next cell
If cnt 0 Then
i = i + 2
If i 140 Then i = 0
End If
Next row

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"hotherps " wrote in message
...
Thanks for the help Frank, I'm almost there. It is incrementing properly
but it is going backwards? It begins counting at 136
and if there are any rows without values it is incrementing the rows as
if the values were there

PACK112 PACK112 PACK112 PACK112 PACK112 PACK112
PACK114 PACK114 PACK114 PACK114 PACK114 PACK114
PACK116 PACK116 PACK116 PACK116 PACK116
PACK118 PACK118 PACK118 PACK118
empty row
empty row
empty row
PACK128 PACK128 PACK128 PACK128 PACK128
PACK130 PACK130 PACK130 PACK130

Is there a way to make it only count on rows that have data?


---
Message posted from http://www.ExcelForum.com/



 
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
Incrementing Rows and Columns Intern Excel Discussion (Misc queries) 1 June 5th 09 05:59 PM
Incrementing numbers problem AJ Excel Worksheet Functions 1 May 23rd 09 03:25 AM
fill down formula incrementing by every 12 rows westy Excel Discussion (Misc queries) 2 September 5th 07 04:54 AM
Incrementing formula by two rows Ben Hur Excel Worksheet Functions 1 February 24th 05 09:21 PM
Automatically 'incrementing' formulas for new rows. MediaScribe New Users to Excel 3 February 21st 05 06:29 PM


All times are GMT +1. The time now is 05:52 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"