ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy named range (https://www.excelbanter.com/excel-programming/296515-copy-named-range.html)

gav meredith

copy named range
 
hi all,

i have a named range "roland". I would like this data range to copy to
another worksheet within the workbook after an existing heading "MANROLAND".
How would i achioeve this. A command button to action this would suffice.

Thanks for your ideas!!!!



mudraker[_192_]

copy named range
 
Gav

Paste this into a normal module sheet

It pastes your data into the same column with the header MANROLAND If
you need it to paste the data into the colmn after this one then
change

ActiveCell.Offset(1, 0).Select

to

ActiveCell.Offset(0, 1).Select





Sub Macro1()

Sheets("Sheet2").Range("roland").Copy

Sheets("Sheet1").Select
Cells.FindNext(After:=ActiveCell).Activate

Cells.Find(What:="manroland", _
After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate

ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
End Sub


---
Message posted from http://www.ExcelForum.com/


gav meredith[_2_]

copy named range
 
thats great!!! Thank you!!

Is there a way to keep the formatting????

----- mudraker wrote: ----

Ga

Paste this into a normal module shee

It pastes your data into the same column with the header MANROLAND I
you need it to paste the data into the colmn after this one the
chang

ActiveCell.Offset(1, 0).Selec

t

ActiveCell.Offset(0, 1).Selec





Sub Macro1(

Sheets("Sheet2").Range("roland").Cop

Sheets("Sheet1").Selec
Cells.FindNext(After:=ActiveCell).Activat

Cells.Find(What:="manroland",
After:=ActiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext,
MatchCase:=False).Activat

ActiveCell.Offset(1, 0).Selec
ActiveSheet.Past
End Su


--
Message posted from http://www.ExcelForum.com



gav meredith[_2_]

copy named range
 
actually, thats fine. It works perfectly

Thank you once again!!!!

gav meredith[_2_]

copy named range
 
hi again

can you please refer to my post 'error message'. I am having a problem with the code when there is a large amount of data to paste. Any help would be great....................again!

Cheers!!

----- mudraker wrote: ----

Ga

Paste this into a normal module shee

It pastes your data into the same column with the header MANROLAND I
you need it to paste the data into the colmn after this one the
chang

ActiveCell.Offset(1, 0).Selec

t

ActiveCell.Offset(0, 1).Selec





Sub Macro1(

Sheets("Sheet2").Range("roland").Cop

Sheets("Sheet1").Selec
Cells.FindNext(After:=ActiveCell).Activat

Cells.Find(What:="manroland",
After:=ActiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext,
MatchCase:=False).Activat

ActiveCell.Offset(1, 0).Selec
ActiveSheet.Past
End Su


--
Message posted from http://www.ExcelForum.com




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

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