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 8576415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:55:08+00:00 2026-06-11T19:55:08+00:00

Why does this copy data down to the next blank cell till the next

  • 0

Why does this copy data down to the next blank cell till the next full cell, then take that cell’s data and start over again?

Option Explicit

Sub CopyDown()

    Dim wsPOD As Worksheet
    Dim lastrow

    Set wsPOD = Sheets("PO Data")

With wsPOD
    lastrow = wsPOD.Range("F" & Rows.Count).End(xlUp).Row
            wsPOD.Range("A2:D" & lastrow).Select
            Selection.SpecialCells(xlCellTypeBlanks).Select
            Selection.FormulaR1C1 = "=R[-1]C"
    End With
End Sub

I understand the majority of the script, but I don’t understand this part:

        Selection.SpecialCells(xlCellTypeBlanks).Select
        Selection.FormulaR1C1 = "=R[-1]C"

The last part especially means gibberish to me, can someone help me understand this please?

  • 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-11T19:55:10+00:00Added an answer on June 11, 2026 at 7:55 pm

    Based on my comment you can tidy up the code using

    Option Explicit

    Sub CopyDown()
    
        Dim wsPOD As Worksheet
        Dim lastrow as long
        Dim EmptyCells as range
    
        Set wsPOD = Sheets("PO Data")
    
    With wsPOD
        lastrow = .Range("F" & .Rows.Count).End(xlUp).Row
                set EmptyCells = .Range("A2:D" & lastrow).SpecialCells(xlCellTypeBlanks)
                EmptyCells.FormulaR1C1 = "=R[-1]C"
        End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create a .BAT file that does this: If C:\myprogram\sync\data.handler exists, exit;
I want to copy a data directory into my distribution dir. copy_tree does this
At assigning one field to another, does the C# just copy data over, or
Does Visual Studio / Resharper support this? By refactor copy I mean to be
Why does Java not have a file copy method? This seems like such an
Does this function has the same behavior that memset ? inline void SetZeroArray( void
Does this seem right, the dataFilePath is on disk and contains the right data,
Does anybody know what the recommend method is to copy data from one table
If I copy data from local system to HDFS, сan I be sure that
Does HTML's data attribute work in IE6? I'm using the attribute like this <img

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.