Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:55:51+00:00 2026-06-14T22:55:51+00:00

I have an excel spreadsheet with a value followed by exactly 29 spaces. I

  • 0

I have an excel spreadsheet with a value followed by exactly 29 spaces. I am trying to find a way to copy that value to the next 29 blank row spaces then loop again and copy the next value to the following 29 spaces.

Each value is different and there is no sequential order. I have over 50,000 rows and I have spent so much time trying to find a way to do this. Any help is much appreciated. I believe I can run a loop to accomplish this however I am a newb. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:55:53+00:00Added an answer on June 14, 2026 at 10:55 pm

    The following should get you where you need to go. Post again with details if you run into any problems with it:

    Sub Copy29Rows()
    
    Dim wks As Excel.Worksheet
    Dim rng_Source As Excel.Range, rng_target As Excel.Range
    
    'Change this to the name of the worksheet that you're working with
    Set wks = ThisWorkbook.Worksheets("Sheet2")
    
    'Change the sheet and cell name to whatever your original source is.
    Set rng_Source = wks.Range("A1")
    
    'Check that there is a value to copy
    If rng_Source.Value = "" Then
        MsgBox "There are no values to copy"
        GoTo ExitPoint
    End If
    
    'We keep looping until we find no further values.
    Do While rng_Source.Value <> ""
    
        'Make sure that you don't run off the end of the sheet
        If rng_Source.Row + 29 > wks.Rows.Count Then
            Err.Raise vbObjectError + 20000, , "There aren't enough empty rows in the sheet to copy down 29 rows."
        End If
    
        'The target will be offset one row from the value that we're
        'copying and will be 29 rows high.
        Set rng_target = rng_Source.Offset(1, 0).Resize(29, rng_Source.Columns.Count)
    
        'Now copy the original value and paste it into the target range
        rng_Source.Copy rng_target
    
        'Finally move the source 30 rows down.
        Set rng_Source = rng_Source.Offset(30, 0)
    
    Loop
    
    ExitPoint:
    On Error Resume Next
    Set rng_Source = Nothing
    Set rng_target = Nothing
    Set wks = Nothing
    On Error GoTo 0
    
    Exit Sub
    
    ErrorHandler:
    MsgBox "Error " & Err.Number & vbCrLf & Err.Description
    
    Resume ExitPoint
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write an app that will open an excel spreadsheet find the
I have an Excel spreadsheet that I have exported from some other program. It
I have an Excel spreadsheet that uses a TFS query to pull information on
I have an Excel spreadsheet that looks like: spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg I'd like to convert
I have an Excel spreadsheet that will sit out on a network share drive.
I have an excel spreadsheet that is password-protected. I need to open this spreadsheet
I have an excel spreadsheet that has two columns. When I choose to save
I am working on a Excel Spreadsheet that when a dropdown box value is
I have an excel spreadsheet that has 2 columns. Something like this |ColA |
i have existing code that generates a spreadsheet from excel using OpenXML. It works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.