ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select a specific row in named range (https://www.excelbanter.com/excel-programming/440313-select-specific-row-named-range.html)

BeSmart

Select a specific row in named range
 
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

Gary Keramidas[_3_]

Select a specific row in named range
 
try this

range("test").rows(2).Select

--


Gary Keramidas
Excel 2003


"BeSmart" wrote in message
...
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



Gary Keramidas[_3_]

Select a specific row in named range
 
or this

range("test").rows(2).entirerow.insert

--


Gary Keramidas
Excel 2003


"BeSmart" wrote in message
...
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



Gary Keramidas[_3_]

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

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

--


Gary Keramidas
Excel 2003


"BeSmart" wrote in message
...
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



FSt1

Select a specific row in named range
 
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

"BeSmart" wrote:

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


BeSmart

Select a specific row in named range
 
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


"FSt1" wrote:

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

"BeSmart" wrote:

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


BeSmart

Select a specific row in named range
 
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
--
Thank for your help
BeSmart


"FSt1" wrote:

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

"BeSmart" wrote:

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


Mike Fogleman[_2_]

Select a specific row in named range
 
See my response to your original post

Mike F
"BeSmart" wrote in message
...
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
--
Thank for your help
BeSmart


"FSt1" wrote:

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

"BeSmart" wrote:

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





All times are GMT +1. The time now is 01:37 AM.

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