Thread: Create a loop
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
stephenc stephenc is offline
external usenet poster
 
Posts: 5
Default Create a loop

Hi Bernard

Thank you for your quick response however I tried this and nothing happened?

"Bernard Liengme" wrote:

Sub Tryme()
mylast = Cells(Cells.Rows.Count, "B").End(xlUp).Row
holdme = Cells(1, 3)
For j = 2 To mylast
If Cells(j, 3) = "" Then
Cells(j, 1) = holdme
Else
holdme = Cells(j, 3)
End If
Next
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"stephenc" wrote in message
...
Hi, Can you please help
My spreadsheet looks like this

Column A, Column B, Column C
Blank 600 8172540
Blank 18/12/2008
Blank 19/12/2008
Blank 19/12/2008
Blank 600 8172559
Blank 18/12/2008
Blank 21/12/2008

Result required

Column A, Column B, Column C
Blank 600 8172540
8172540 18/12/2008
8172540 19/12/2008
8172540 19/12/2008
Blank 600 8172559
8172559 18/12/2008
8172559 21/12/2008

I am trying to create a loop in a macro that will look at column B,
identify
the value of 600 and copy the value in column c into column A until the
value
of 600 in column B re-occurs at which point it then copies Column C into
Column A until 600 occurs in Column B etc etc,