LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Need help with one line of code

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to put series name next to individual line in line grap Otani Charts and Charting in Excel 3 February 23rd 10 07:24 PM
What does this line of code do please? [email protected] Excel Programming 3 July 26th 06 05:22 PM
Code to delete a Line in a another code helmekki[_88_] Excel Programming 1 August 8th 05 01:14 AM
Continue line of VBA code on the next line peacelittleone Excel Programming 9 June 24th 05 07:46 PM
Help with 1 code line JMay Excel Programming 6 June 7th 04 03:16 AM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"