View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
fred fred is offline
external usenet poster
 
Posts: 73
Default Macro To Copy Down

Jamesa, try

Sub CopyDown()
Const StartRowNo = 1
Const EndRowNo = 2000
Const ColumnNo = 1
Dim curText As String, curRowNo As Long

curRowNo = StartRowNo
Do While IsEmpty(Cells(curRowNo, ColumnNo)) And curRowNo <= EndRowNo
curRowNo = curRowNo + 1
Loop

Do While curRowNo <= EndRowNo
If IsEmpty(Cells(curRowNo, ColumnNo).Value) Then
Cells(curRowNo, ColumnNo).Value = curText
Else
curText = Cells(curRowNo, ColumnNo).Value
End If
curRowNo = curRowNo + 1
Loop
End Sub


Good luck

"Jamesa" wrote in message
...
I want to copy data down a column in a ws until it finds
an existing text in the same column. It should then copy
that text down the same column until it finds the next
text entry and so on.
Would someone please help me with a macro or vb for this
task. I would be very grateful.

Hoping to hear from you soon.
JA