ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro help on Cell Selection (https://www.excelbanter.com/excel-programming/328251-macro-help-cell-selection.html)

Nigel

Macro help on Cell Selection
 
Hi,
Currently, i have written a macro that will select a new sheet based on
certain criteria in specific cells. i.e. if B4 contains "text" then move to
the next sheet until it finds "Complete". this is then your next sheet to
use. i now need to create something very similar but everything is to stay on
1 sheet so it need to look at the cells. If the cell contains anything, i
need to select the cell underneath which is empty. Or keep looking down a
column of cells until it finds an empty one. i hope this is understandable!

example:
range is B4 to B25. ( i need to update this column every day)
B4 contains data
B5 contains data
B6 contains nothing
therfore when i issue my macro, it will look at the B column and
automatically select the cell B6 as it contains nothing.

Is this acheivable??

Kind Regards,


Nigel

Carim[_3_]

Macro help on Cell Selection
 
Hi Nigel,

Following code will do the job :
Application.Goto Range("B4")
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select

HTH
Carim


Bob Phillips[_7_]

Macro help on Cell Selection
 
Nigel,

Start the macro recorder and go through the steps that you describe. You can
then post that code and get help on modifying it to be more generic.

--
HTH

Bob Phillips

"Nigel" wrote in message
...
Hi,
Currently, i have written a macro that will select a new sheet based on
certain criteria in specific cells. i.e. if B4 contains "text" then move

to
the next sheet until it finds "Complete". this is then your next sheet to
use. i now need to create something very similar but everything is to stay

on
1 sheet so it need to look at the cells. If the cell contains anything, i
need to select the cell underneath which is empty. Or keep looking down a
column of cells until it finds an empty one. i hope this is

understandable!

example:
range is B4 to B25. ( i need to update this column every day)
B4 contains data
B5 contains data
B6 contains nothing
therfore when i issue my macro, it will look at the B column and
automatically select the cell B6 as it contains nothing.

Is this acheivable??

Kind Regards,


Nigel




Nigel

Macro help on Cell Selection
 
Hi,

Carims code worked fine once you have somethin in your range. Exactly what i
was looking for. Thanks Carim :)

Nigel

"Bob Phillips" wrote:

Nigel,

Start the macro recorder and go through the steps that you describe. You can
then post that code and get help on modifying it to be more generic.

--
HTH

Bob Phillips

"Nigel" wrote in message
...
Hi,
Currently, i have written a macro that will select a new sheet based on
certain criteria in specific cells. i.e. if B4 contains "text" then move

to
the next sheet until it finds "Complete". this is then your next sheet to
use. i now need to create something very similar but everything is to stay

on
1 sheet so it need to look at the cells. If the cell contains anything, i
need to select the cell underneath which is empty. Or keep looking down a
column of cells until it finds an empty one. i hope this is

understandable!

example:
range is B4 to B25. ( i need to update this column every day)
B4 contains data
B5 contains data
B6 contains nothing
therfore when i issue my macro, it will look at the B column and
automatically select the cell B6 as it contains nothing.

Is this acheivable??

Kind Regards,


Nigel






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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com