Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Line selection from a cell script through a VBA macro | Setting up and Configuration of Excel | |||
Macro - Dynamic cell selection | Excel Discussion (Misc queries) | |||
Cell selection in a macro | Excel Programming | |||
Cell selection in a macro | Excel Programming | |||
Selection.Replace doesn't update the cell value in macro! | Excel Programming |