![]() |
Selecting Data in Column
The following code gets the last data cell in column B:
Range("b20000").End(xlUp).Select I would now like to select the Range("Activecell:B2"). How do I do that? Thank you for your help. |
Selecting Data in Column
Hi
try range(cells(2,2),cells(ActiveSheet.Cells(Rows.Coun t, "B").End(xlUp).row,2)).select though in most cases it is not required to select cells within in macro -- Regards Frank Kabel Frankfurt, Germany Rex Dunlap wrote: The following code gets the last data cell in column B: Range("b20000").End(xlUp).Select I would now like to select the Range("Activecell:B2"). How do I do that? Thank you for your help. |
Selecting Data in Column
Hi Rex,
Try Range("B2:B" & RANGE("B20000").End(xlUp).Row).Select -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Rex Dunlap" wrote in message ... The following code gets the last data cell in column B: Range("b20000").End(xlUp).Select I would now like to select the Range("Activecell:B2"). How do I do that? Thank you for your help. |
Selecting Data in Column
Frank, just so I learn this correctly, you say that I
don't need to select cells to do something with a macro. What I wanted to was select all the blank cells in B and put the word "NO" in them. With your help this is what I have: Range("b20000").End(xlUp).Select Range(Cells(5, 2), Cells(ActiveSheet.Cells (Rows.Count, "B").End(xlUp).Row, 2)).Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "NO" Range("A4").Select Would you do it differently? Thanks for your help in at least getting me this far and saving me so much time! Kind regards, Rex -----Original Message----- Hi try range(cells(2,2),cells(ActiveSheet.Cells(Rows.Cou nt, "B").End(xlUp).row,2)).select though in most cases it is not required to select cells within in macro -- Regards Frank Kabel Frankfurt, Germany Rex Dunlap wrote: The following code gets the last data cell in column B: Range("b20000").End(xlUp).Select I would now like to select the Range("Activecell:B2"). How do I do that? Thank you for your help. . |
Selecting Data in Column
This
Range(Cells(5, 2), Cells(ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row, 2)).Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "NO" Range("A4").Select can be written as Range("B5:B" & Range("B" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellType Blanks).Value = "NO" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Rex" wrote in message ... Frank, just so I learn this correctly, you say that I don't need to select cells to do something with a macro. What I wanted to was select all the blank cells in B and put the word "NO" in them. With your help this is what I have: Range("b20000").End(xlUp).Select Range(Cells(5, 2), Cells(ActiveSheet.Cells (Rows.Count, "B").End(xlUp).Row, 2)).Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "NO" Range("A4").Select Would you do it differently? Thanks for your help in at least getting me this far and saving me so much time! Kind regards, Rex -----Original Message----- Hi try range(cells(2,2),cells(ActiveSheet.Cells(Rows.Cou nt, "B").End(xlUp).row,2)).select though in most cases it is not required to select cells within in macro -- Regards Frank Kabel Frankfurt, Germany Rex Dunlap wrote: The following code gets the last data cell in column B: Range("b20000").End(xlUp).Select I would now like to select the Range("Activecell:B2"). How do I do that? Thank you for your help. . |
Selecting Data in Column
Thank you very much, Bob.
-----Original Message----- This Range(Cells(5, 2), Cells(ActiveSheet.Cells (Rows.Count, "B").End(xlUp).Row, 2)).Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "NO" Range("A4").Select can be written as Range("B5:B" & Range("B" & Rows.Count).End(xlUp).Row).SpecialCells (xlCellTypeBlanks).Value = "NO" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Rex" wrote in message ... Frank, just so I learn this correctly, you say that I don't need to select cells to do something with a macro. What I wanted to was select all the blank cells in B and put the word "NO" in them. With your help this is what I have: Range("b20000").End(xlUp).Select Range(Cells(5, 2), Cells(ActiveSheet.Cells (Rows.Count, "B").End(xlUp).Row, 2)).Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "NO" Range("A4").Select Would you do it differently? Thanks for your help in at least getting me this far and saving me so much time! Kind regards, Rex -----Original Message----- Hi try range(cells(2,2),cells(ActiveSheet.Cells(Rows.Cou nt, "B").End(xlUp).row,2)).select though in most cases it is not required to select cells within in macro -- Regards Frank Kabel Frankfurt, Germany Rex Dunlap wrote: The following code gets the last data cell in column B: Range("b20000").End(xlUp).Select I would now like to select the Range ("Activecell:B2"). How do I do that? Thank you for your help. . . |
All times are GMT +1. The time now is 02:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com