View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Copying a cell value to a specific cells

hi
would have been nice if you had posted your code.
but this sniplet does what you want. use it as an example.
Sub doit()
Dim r As Range
Set r = Range("A1:A10")
For Each cell In r
If cell = "x" Then 'find object
For y = 1 To 10
cell.Offset(0, y) = "x"
Next y
End If
Next cell
End Sub

regards
FSt1
"MJKelly" wrote:

Hi,

I am looping through a range of cells looking for certain criteria.
When one is reached, I want to copy the value into the next 10 cells
in the same row as the active cell in the loop. I am trying to use
the offset property to do this but cannot get it to work. Is this the
right way to approach this?

kind regards,
Matt