Thread
:
Selecting a cell in a row just inserted in a range.
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Selecting a cell in a row just inserted in a range.
Try this. Be advised that it is almost always NOT necessary to select
anything.
Sub insertrowandgo()
Cells(Range("myrng").Rows.Count, 2).Select
Selection.EntireRow.Insert
End Sub
--
Don Guillett
SalesAid Software
"Shannon" wrote in message
...
I'm trying to select a cell in column 2 of a row that is just inserted
into a
range using a macro. After searching the group discussion, I found and
modified this script to actually insert the row. I now need to modify it
to
select the cell (make it active) in column 2 of the row that was just
inserted. This macro is started with a button and the active cell could
be
anywhere when the button is pressed.
Here's the code I'm starting with to insert a row:
Dim DGrng As Range
Set DGrng = Range("DG")
Set DGrng = DGrng.Rows(DGrng.Rows.Count)
Sheets("Preliminary Report").Unprotect
DGrng.EntireRow.Insert
Sheets("Preliminary Report").Protect
Thanks in Advance!
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett