Select a specific row in named range

B

BeSmart

Hi All
I need to select the second row in a named range ("Overviewfinal") and
insert copied rows so that the named range expands to take the new data.

I tried the following, but got an error??
Could someone tell me what I've done wrong & how I should do this?
....
Sheets("Overview Template").Select
Range("Overviewfinal").Range(Cells(1, 1)).EntireRow.Select
Selection.Insert Shift:=xlDown
.....
Thank for your help
BeSmart
 
G

Gary Keramidas

after rereading, i think you may want to just insert a row in the range

range("test").rows(2).insert Shift:=xlDown
 
F

FSt1

hi
another way...
Range("A20").EntireRow.Copy
Range("Myrange").Resize(1, 1).Offset(1, 0).EntireRow.Insert shift:=xlDown
Range("Myrange").Resize(1, 1).Offset(1, 0).PasteSpecial xlPasteAll

mine may be a little more wordy but it works too.
notice that nothing was selected.
regards
FSt1
 
B

BeSmart

Hi Gary & FSt1
All of your suggestions worked great!!!
Thank you very much for your help.
I ended up using Gary's third suggestion.
Regards
BeSmart
 
B

BeSmart

Gary, Perhaps you can help me with another small problem I've posted - but go
no response on...

Where "D" appears below, I need it to look at a range of "D:"BJ" - not just
one column.
Again I've tried to enter a range (including changing the Dim), but I keep
getting an error of type mismatch...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Integer
Dim Z As Integer

For Z = 17 To Cells(Rows.Count, "C").End(xlUp).Row
For Cell = 43 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(Cell, "A").Value Like "*" & Range("C" & Z).Value & "*" Then
If Cells(Cell, "D").Value > "0" Then
Cells(Cell, "D").Interior.Color = Range("C" & Z).Interior.Color
End If
End If
Next Cell
Next Z
End Sub
 
M

Mike Fogleman

See my response to your original post

Mike F
BeSmart said:
Gary, Perhaps you can help me with another small problem I've posted - but
go
no response on...

Where "D" appears below, I need it to look at a range of "D:"BJ" - not
just
one column.
Again I've tried to enter a range (including changing the Dim), but I keep
getting an error of type mismatch...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Integer
Dim Z As Integer

For Z = 17 To Cells(Rows.Count, "C").End(xlUp).Row
For Cell = 43 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(Cell, "A").Value Like "*" & Range("C" & Z).Value & "*" Then
If Cells(Cell, "D").Value > "0" Then
Cells(Cell, "D").Interior.Color = Range("C" & Z).Interior.Color
End If
End If
Next Cell
Next Z
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top