Solved

Excel VBA Special Cells by Column

Posted on 2013-02-06
2
484 Views
Last Modified: 2013-02-06
I need to fill in blank spaces in column C in a spreadsheet.  The loop should start from the bottom of column C and step up. If the next cell up is blank, I need to copy and paste from the cell below.  The problem I'm having is my code selects all the blank cells and copies from the cell below. I just want this copying to happen in column C.
What am I missing?

Sub Macro2()

Dim LastRow As Long
Dim i As Long
 
 Application.ScreenUpdating = False
 
    LastRow = Range("A" & Rows.Count).End(xlUp).Row
    
     For i = LastRow To 1 Step -1
       Columns("C:C").Select
            Selection.SpecialCells(xlCellTypeBlanks).Select
            Selection.FormulaR1C1 = "=R[+1]C"    
        Next i
Application.ScreenUpdating = True

End Sub

Open in new window

0
Comment
Question by:minamina6
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38859777
Without looping try

Range("C1:C" & lastrow).specialcells(xlcelltypeblanks).formular1c1= "=R[+1]C"
0
 

Author Closing Comment

by:minamina6
ID: 38859807
That worked. Thanks!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now