View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
hotherps[_2_] hotherps[_2_] is offline
external usenet poster
 
Posts: 1
Default New to vba trying to assign # to strings

That worked great Bob! I'm really going to have to look at it to try an
figure out exactly what is happening.
Let me ask one more question. Let's say that I do not want the sam
Pack number in any given column. i.e. Col F, Row 5 = Pack1 I do no
want any more cells in Col F to be pack Pack1 instead Increment th
number

I'm thinking an If statement somewhere in there would do it? But how t
phrase it?


Bob Phillips wrote:
*Untested.

i = 0
For Each cell In Range("H10:DD2567")
If cell.Value = "Pack" Then
i = i+1
For j = 1 To 8
cell.Offset(0,j).Value = "Pack" & CStr(i)
Next j
IF i 40 i = 0
End If
Next cell

--

HTH

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

"hotherps " wrote i
message
...
I think what I am trying to do is not that difficult, but I jus

can't
get it. I have a spreadsheet with a range of H:10 to DD:267 th

work
"Pack" appears it is an assignment. I amtry to number eac

occurence of
"Pack" i.e. Pack1, Pack2 up to Pack41. When the code finds the wor

I
want it to fill in the next 8 cells to the right with the name Pac

and
the incremented number. It should loop through all of the rows
repeating the same pattern until it reachs Pack41, it should the

start
over at Pack1 and continue to loop to the end of the range.

Is this very complicated? I'm trying for...next, do until..

nothing
works

Thanks

Attachment filename: numberpack.xls
Download attachment:

http://www.excelforum.com/attachment.php?postid=411038
---
Message posted from http://www.ExcelForum.com/
* :


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