Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Increment row change by two

I'm trying to get the code to increment by two every time it drops dow
a row. But all I can get it to do is increment on the same row
Basically I want it to add a number to the value "Bulk" for each cel
on that row. Then drop down one row and do it again but increment th
number by two. The result would be like:

BULK112 BULK112 BULK112
BULK114 BULK114 BULK114
Thanks

Dim arr()
ReDim Preserve arr(0)

i = 112
For Each CELL In Range("K10:DB50")
i = i + 2
If CELL.Value = "BULK" Then
ReDim Preserve arr(UBound(arr) + 1)
arr(UBound(arr)) = i

CELL.Value = "BU" & CStr(i)
If i 136 Then i = 112
End If
Next CELL

i = 100
For Each CELL In Range("K10:DB20")
If CELL.Value = "Pack" Then
i = i + 1
found = 0
On Error Resume Next
found = WorksheetFunction.Match(i, arr, 0)
If found Then i = i + 1

CELL.Value = "Pack" & CStr(i)

If i 145 Then i = 100
End If
Next CELL
End Su

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

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
Increment by 18 John Excel Worksheet Functions 1 October 8th 09 02:55 AM
change formula- keep cell increment sheet numbers Ali Excel Discussion (Misc queries) 3 March 24th 09 09:31 AM
Formula copy paste down in a sheet but change row letter increment Mike Excel Discussion (Misc queries) 13 December 15th 08 05:35 PM
Increment Maria Excel Worksheet Functions 4 November 9th 07 12:10 AM
need to increment value Tom Excel Discussion (Misc queries) 5 June 24th 05 12:54 PM


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