Copying cells a set no. of times with a referance to the num
Copying cells a set no. of times with a referance to the num
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Copying cells a set no. of times with a referance to the num

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    have code which works for a set integer value want code which works for an integer value which is found in a cell Ie the program counts the number of cells present stores this in a cell then decides how many times to copy another cells data down with referance contained in the counted cell.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    SRC
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hope this is the sort of thing you were after

    Sub Test()
    Dim CopyTimes As Integer
    Dim CopyLoop As Integer

    CopyTimes = Worksheets("sheet1").Range("A1").Value
    If CopyTimes <= 1 Then Exit Sub
    For CopyLoop = 1 To CopyTimes
    'assume A2 has the data, B2 is the place to start storeing
    Worksheets("sheet1").Range("B" & CopyLoop + 1).Value = Worksheets("sheet1").Range("A2").Value
    Next CopyLoop

    End Sub
    On 2002-02-20 04:53, drag-driver wrote:
    have code which works for a set integer value want code which works for an integer value which is found in a cell Ie the program counts the number of cells present stores this in a cell then decides how many times to copy another cells data down with referance contained in the counted cell.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com