Results 1 to 7 of 7

How do you repeat a value x times then move on to the next cell below for the same?

Threaded View

  1. #1
    Registered User
    Join Date
    11-17-2014
    Location
    New England
    MS-Off Ver
    2010
    Posts
    4

    How do you repeat a value x times then move on to the next cell below for the same?

    Hi everyone, just joined. So, I have a question regarding duplicating a cell on another sheet x times, then moving to the next row in the column, repeating that one the same number of times, etc. I have this, which works for the first cell if I have a formula in A1 referencing the other sheet:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim X As Long, LastRow As Long
    
    LastRow = Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row
    Application.ScreenUpdating = False
    X = Range("C1").Value
    
    If X = "" Or X = 0 Then Exit Sub
    
    Range("A2:A" & LastRow).ClearContents
    Range("A1").Select
    Selection.AutoFill Destination:=Range("A1:A" & X), Type:=xlFillDefault
    Range("A1").Select
    Range("C1").Value = ""
    End Sub

    Any help would be great. I have 250ish unique cells in the same column that I need repeated 49 times all in the same column on another sheet. Thanks!
    Last edited by JBeaucaire; 11-17-2014 at 08:14 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Repeat cell values a certain number of times
    By strother1990 in forum Excel General
    Replies: 2
    Last Post: 09-24-2014, 12:43 PM
  2. Replies: 4
    Last Post: 03-08-2014, 08:01 AM
  3. [SOLVED] Repeat a formula 5 times before changing cell reference
    By amartin575 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-28-2014, 04:11 PM
  4. How to repeat a macro x number of times based on a value in a cell
    By gypsyhotelier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2011, 05:11 PM
  5. Repeat a cell value in another column X number of times
    By art1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2011, 02:36 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1