Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Copying a cell value to a specific cells

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


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
copying cells at a specific interval ANton Petrov Excel Programming 2 January 31st 07 01:00 AM
Copying specific value in cell into next empty row on different sheet michaelberrier Excel Discussion (Misc queries) 1 December 29th 06 09:54 PM
Copying specific cells from a sheet to another Catalin Excel Discussion (Misc queries) 1 July 28th 06 11:59 PM
Specific keywords copying data to cells Leo Edwards Excel Worksheet Functions 6 June 12th 06 03:20 PM
Copying block (range of cells) based on a value of a specific cell-VBA Branimir Excel Programming 1 October 15th 03 06:07 PM


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