Home |
Search |
Today's Posts |
#1
|
|||
|
|||
I Need VBA Assistance for EOF
Good afternoon,
I need to know a VBA command that will look at all cells in Column B until end of file or EOF. I tried DO UNTIL ... EOF, but didn't seem to work. Is this valid? Thanks. |
#2
|
|||
|
|||
It depends on how your data is populated in column B. You could
instruct Excel to evaluate each cell until a blank cell is encountered (if the data is contiguous), or run for a given number of repetitions. Here's an example of code that starts at cell B3, moves down a cell and evaluates the entry in that cell, and stops when it encounters a cell with the value "stop". sub Evaluate_Column_B range("b3").select do until activecell.value = "stop" {{{your process here}}} activecell.offset(1,0).select loop end sub |
#3
|
|||
|
|||
Forgot to mention: make sure you type the word "stop" into a cell at
the bottom of your data, or else this will run for all 65,000 rows in the tab and then create an error. |
#4
|
|||
|
|||
Brent
Sub findbottom() ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Select End Sub Gord Dibben Excel MVP On Fri, 25 Feb 2005 13:39:02 -0800, "Brent E" wrote: Good afternoon, I need to know a VBA command that will look at all cells in Column B until end of file or EOF. I tried DO UNTIL ... EOF, but didn't seem to work. Is this valid? Thanks. |
#5
|
|||
|
|||
The EOF file command has to do with what it says, "file", i.e. it's for
detecting the end of a text file that you are reading with Input, Line Input, etc. On Fri, 25 Feb 2005 13:39:02 -0800, "Brent E" wrote: Good afternoon, I need to know a VBA command that will look at all cells in Column B until end of file or EOF. I tried DO UNTIL ... EOF, but didn't seem to work. Is this valid? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula assistance required!!! | Excel Discussion (Misc queries) | |||
Need VBA assistance for Excel Open Dialogue box | Excel Discussion (Misc queries) | |||
Drop Down Help Assistance is very confusing. Can someone help me. | Excel Discussion (Misc queries) | |||
Turn off Assistance pane in Excel | Excel Discussion (Misc queries) | |||
Need assistance with cell formatting | Excel Worksheet Functions |