Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Prior to performing a search and replace operation on column C (where Im
searching for blank cells and replacing them with n/a), I want to first select the range in column C based on the last row of data contained in column A. Note: the number of rows containing data (based on column A) will always be GREATER than the number of rows containing data (based on column C). In other words, there will always be more data-containing cells in column A than in column C. Bob Phillips was kind enough to provide me with the following three lines of code for determining the last row of data (based on column A) and then performing a copy/paste operation on column J: Dim iLastRow As Long iLastRow = Cells(Rows.Count, "A").End(xlUp).Row Range("J2").AutoFill Range("J2").Resize(iLastRow - 1) Now, using Bobs 3rd line of code, Ive been trying to modify it (Im a VBA novice) so that it will select the appropriate number of cells in column C, based on the number of data-containing rows in column A: Dim iLastRow As Long iLastRow = Cells(Rows.Count, "A").End(xlUp).Row Range("C2").Select Selection.Resize (iLastRow - 1) Unfortunately, when I execute the code I receive an error message. Can someone tell me the correct syntax for the 3rd line of code? I would greatly appreciate it. Thanks, Bob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to put series name next to individual line in line grap | Charts and Charting in Excel | |||
What does this line of code do please? | Excel Programming | |||
Code to delete a Line in a another code | Excel Programming | |||
Continue line of VBA code on the next line | Excel Programming | |||
Help with 1 code line | Excel Programming |