LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help stopping when row is blank

I am new to VBA. I recorded a macro and applied it to the command
button to fill two seperate ranges down. Now I want to edit the code to
do the following:
After I run (click the command button), the cursor stops at the cell
"F1169". I fill in the cells in column "H" with an "x" to indicate I
have finished analyizing that row. I would like the cursor to change
locations based on if the cell in column H is blank by going to the
last cell in column H with an "x" and then offset (-1,-2).
Also, when I recorded the macro, I set the range (to fill down) to
1500. I add new rows to include more data daily. The 1500# was overkill
and I only used it because I will never have that much data. I would
like to clean up the range down to stop if there is nothing in the last
row of column "C". I hope some of this makes sense. I have been
researching to find an answer on my own with no luck. Please help.

Private Sub CommandButton1_Click()
Range("F4").Select
Selection.AutoFill Destination:=Range("F4:F1500"),
Type:=xlFillDefault
Range("F4:F1500").Select
ActiveWindow.LargeScroll Down:=-42
ActiveWindow.SmallScroll Down:=-21
Range("O4:P4").Select
Selection.AutoFill Destination:=Range("O4:P1500"),
Type:=xlFillDefault
Range("O4:P1500").Select
ActiveWindow.LargeScroll Down:=-19
ActiveWindow.SmallScroll Down:=249
Range("F1169").Select
End Sub

 
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
Stopping IF command from entering zero or 1 for blank cells Nick S Excel Worksheet Functions 3 November 20th 09 05:41 PM
Stopping blank page printing F*SH Charts and Charting in Excel 0 July 24th 06 11:39 AM
Stopping blank cells with formulae in from printing nickname[_2_] Excel Programming 6 December 1st 05 02:25 AM
counting from left to right and stopping when blank harpscardiff Excel Discussion (Misc queries) 6 August 19th 05 07:34 PM
Stopping chart line where 1 of 2 columns of data in calculation is blank Roger B. Charts and Charting in Excel 2 July 17th 05 07:32 PM


All times are GMT +1. The time now is 04:01 AM.

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"