Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BJ BJ is offline
external usenet poster
 
Posts: 51
Default Copy & Paste Named Range Contents

How do I copy and paste the 'contents' of a Named Range via VBA? I don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet name
'Data', how do I code in VBA the ability to paste the contents of 'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy & Paste Named Range Contents

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA? I don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet name
'Data', how do I code in VBA the ability to paste the contents of 'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.programming
BJ BJ is offline
external usenet poster
 
Posts: 51
Default Copy & Paste Named Range Contents

Thanks Rick - worked great - but I forgot to mention that I need to transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA? I don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet name
'Data', how do I code in VBA the ability to paste the contents of 'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy & Paste Named Range Contents

That was a big item to forget.<g Try it this way then...

Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
Thanks Rick - worked great - but I forgot to mention that I need to
transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA? I
don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet name
'Data', how do I code in VBA the ability to paste the contents of
'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.




  #5   Report Post  
Posted to microsoft.public.excel.programming
BJ BJ is offline
external usenet poster
 
Posts: 51
Default Copy & Paste Named Range Contents

I know ... I'm a forgetful putz ... my wife would agree ... =)

When I use the code I'm getting a VBA error ...

With the word 'Transpose' highlighted the dialog box indicates:
Compile Error: Expected: end of statement

Is there a space between 'PasteSpecial' and 'Transpose'? (That's when I get
the error message). If I remove the space I get the same error but the ':='
is now highlighted instead.

My apologies for my stupidity.

bj

"Rick Rothstein (MVP - VB)" wrote:

That was a big item to forget.<g Try it this way then...

Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
Thanks Rick - worked great - but I forgot to mention that I need to
transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA? I
don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet name
'Data', how do I code in VBA the ability to paste the contents of
'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy & Paste Named Range Contents

Sorry, I should have included the worksheet reference for the Table. Try
this...

Worksheets("Data").Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
I know ... I'm a forgetful putz ... my wife would agree ... =)

When I use the code I'm getting a VBA error ...

With the word 'Transpose' highlighted the dialog box indicates:
Compile Error: Expected: end of statement

Is there a space between 'PasteSpecial' and 'Transpose'? (That's when I
get
the error message). If I remove the space I get the same error but the
':='
is now highlighted instead.

My apologies for my stupidity.

bj

"Rick Rothstein (MVP - VB)" wrote:

That was a big item to forget.<g Try it this way then...

Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
Thanks Rick - worked great - but I forgot to mention that I need to
transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA? I
don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet
name
'Data', how do I code in VBA the ability to paste the contents of
'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.





  #7   Report Post  
Posted to microsoft.public.excel.programming
BJ BJ is offline
external usenet poster
 
Posts: 51
Default Copy & Paste Named Range Contents

Hi Rick - many many thanks ...

I've got some empty columns as part of my named range. When the range is
copied, the blank columns are removed. Is that a permanent issue or is there
a workaround?

"Rick Rothstein (MVP - VB)" wrote:

Sorry, I should have included the worksheet reference for the Table. Try
this...

Worksheets("Data").Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
I know ... I'm a forgetful putz ... my wife would agree ... =)

When I use the code I'm getting a VBA error ...

With the word 'Transpose' highlighted the dialog box indicates:
Compile Error: Expected: end of statement

Is there a space between 'PasteSpecial' and 'Transpose'? (That's when I
get
the error message). If I remove the space I get the same error but the
':='
is now highlighted instead.

My apologies for my stupidity.

bj

"Rick Rothstein (MVP - VB)" wrote:

That was a big item to forget.<g Try it this way then...

Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
Thanks Rick - worked great - but I forgot to mention that I need to
transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA? I
don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet
name
'Data', how do I code in VBA the ability to paste the contents of
'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy & Paste Named Range Contents

Hmm! I'm not sure what to tell you as that does not happen on my XL2003
system... blank columns become blank rows after the transpose. Do you have
any other code running along with what I posted? If so, could you show it to
us?

Rick


"BJ" wrote in message
...
Hi Rick - many many thanks ...

I've got some empty columns as part of my named range. When the range is
copied, the blank columns are removed. Is that a permanent issue or is
there
a workaround?

"Rick Rothstein (MVP - VB)" wrote:

Sorry, I should have included the worksheet reference for the Table. Try
this...

Worksheets("Data").Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
I know ... I'm a forgetful putz ... my wife would agree ... =)

When I use the code I'm getting a VBA error ...

With the word 'Transpose' highlighted the dialog box indicates:
Compile Error: Expected: end of statement

Is there a space between 'PasteSpecial' and 'Transpose'? (That's when
I
get
the error message). If I remove the space I get the same error but the
':='
is now highlighted instead.

My apologies for my stupidity.

bj

"Rick Rothstein (MVP - VB)" wrote:

That was a big item to forget.<g Try it this way then...

Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
Thanks Rick - worked great - but I forgot to mention that I need to
transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA?
I
don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet
name
'Data', how do I code in VBA the ability to paste the contents of
'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.







  #9   Report Post  
Posted to microsoft.public.excel.programming
BJ BJ is offline
external usenet poster
 
Posts: 51
Default Copy & Paste Named Range Contents

Sometimes even my stupidity astounds me ... I had left the transpose = true
statement in ... maybe it's time to go outside and enjoy the 90 degree MN
summer for a while ... =)

Many thanks again Rick - your responsiveness on this board is truly a
blessing ...

"Rick Rothstein (MVP - VB)" wrote:

Hmm! I'm not sure what to tell you as that does not happen on my XL2003
system... blank columns become blank rows after the transpose. Do you have
any other code running along with what I posted? If so, could you show it to
us?

Rick


"BJ" wrote in message
...
Hi Rick - many many thanks ...

I've got some empty columns as part of my named range. When the range is
copied, the blank columns are removed. Is that a permanent issue or is
there
a workaround?

"Rick Rothstein (MVP - VB)" wrote:

Sorry, I should have included the worksheet reference for the Table. Try
this...

Worksheets("Data").Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
I know ... I'm a forgetful putz ... my wife would agree ... =)

When I use the code I'm getting a VBA error ...

With the word 'Transpose' highlighted the dialog box indicates:
Compile Error: Expected: end of statement

Is there a space between 'PasteSpecial' and 'Transpose'? (That's when
I
get
the error message). If I remove the space I get the same error but the
':='
is now highlighted instead.

My apologies for my stupidity.

bj

"Rick Rothstein (MVP - VB)" wrote:

That was a big item to forget.<g Try it this way then...

Range("Table").Copy
Worksheets("Summary").Range("G10").PasteSpecial Transpose:=True
Application.CutCopyMode = False

Rick


"BJ" wrote in message
...
Thanks Rick - worked great - but I forgot to mention that I need to
transpose
the data. How do I work in the PasteSpecial code?

"Rick Rothstein (MVP - VB)" wrote:

Try this statement...

Range("Table").Copy Worksheets("Summary").Range("G10")

Rick


"BJ" wrote in message
...
How do I copy and paste the 'contents' of a Named Range via VBA?
I
don't
want to copy and paste the range name.

For example, if the Named Range 'Table' is cells A1:F10 of Sheet
name
'Data', how do I code in VBA the ability to paste the contents of
'Table'
into sheet name 'Summary' starting at cell G10?

Thank you.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy contents of a named range to a section on working area Steve Excel Discussion (Misc queries) 1 May 22nd 09 10:36 PM
After Copy and Paste, Add to an Existing Named Range Aria[_2_] Excel Programming 4 March 8th 07 12:53 AM
Copy and Paste 2 columns from a named range? Simon Lloyd[_735_] Excel Programming 2 May 28th 06 08:10 PM
Copy named range contents to activecell position Neal Excel Programming 2 October 28th 04 02:20 PM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"