Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default copy and paste values in a range

with worksheets("sheet9999")
.range("b4:ad49").copy _
destination:=.range("b53")
end with

If you really only need values:

dim RngToCopy as range
with worksheets("sheet9999")
set rngtocopy = .range("b4:ad49")
.range("b53").resize(rngtocopy.rows.count,rngtocop y.columns.count).value _
= rngtocopy.value
end with

Or
with worksheets("sheet9999")
.range("b4:ad49").copy
.range("b53").pastespecial paste:=xlpastespecialvalues
end with



Dave F wrote:

This should be a simple VBA routine:

I have a range, B4:AD49

I want to copy the range and paste its values in another range. The upper
left hand corner of this new range would be B53 of the same worksheet. How
would I do this via VBA?

(Why am I doing this? Because this sheet is part of a larger model, and the
sheet is being used by a novice to Excel who needs only the values in the
aforementioned range. I figure copying this range and pasting its values
elsewhere on the sheet is the easiest way to idiot-proof the data. Once I
figure out how to copy and paste the values in range B4:AD49, I'll then have
the macro hide rows that don't need to be viewed by the novice user.)
--
Brevity is the soul of wit.


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default copy and paste values in a range

just curious, what would be wrong with just using 1 line like this?

Range("B4:AD49").Copy Range("B53")

--


Gary


"Dave Peterson" wrote in message
...
with worksheets("sheet9999")
.range("b4:ad49").copy _
destination:=.range("b53")
end with

If you really only need values:

dim RngToCopy as range
with worksheets("sheet9999")
set rngtocopy = .range("b4:ad49")
.range("b53").resize(rngtocopy.rows.count,rngtocop y.columns.count).value _
= rngtocopy.value
end with

Or
with worksheets("sheet9999")
.range("b4:ad49").copy
.range("b53").pastespecial paste:=xlpastespecialvalues
end with



Dave F wrote:

This should be a simple VBA routine:

I have a range, B4:AD49

I want to copy the range and paste its values in another range. The upper
left hand corner of this new range would be B53 of the same worksheet. How
would I do this via VBA?

(Why am I doing this? Because this sheet is part of a larger model, and the
sheet is being used by a novice to Excel who needs only the values in the
aforementioned range. I figure copying this range and pasting its values
elsewhere on the sheet is the easiest way to idiot-proof the data. Once I
figure out how to copy and paste the values in range B4:AD49, I'll then have
the macro hide rows that don't need to be viewed by the novice user.)
--
Brevity is the soul of wit.


--

Dave Peterson



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default copy and paste values in a range

Absolutely nothing.

I just like to fully qualify my ranges (with worksheets(...)) and I like to use
named parameters. And I like two lines--just for ease of reading.



Gary Keramidas wrote:

just curious, what would be wrong with just using 1 line like this?

Range("B4:AD49").Copy Range("B53")

--

Gary

"Dave Peterson" wrote in message
...
with worksheets("sheet9999")
.range("b4:ad49").copy _
destination:=.range("b53")
end with

If you really only need values:

dim RngToCopy as range
with worksheets("sheet9999")
set rngtocopy = .range("b4:ad49")
.range("b53").resize(rngtocopy.rows.count,rngtocop y.columns.count).value _
= rngtocopy.value
end with

Or
with worksheets("sheet9999")
.range("b4:ad49").copy
.range("b53").pastespecial paste:=xlpastespecialvalues
end with



Dave F wrote:

This should be a simple VBA routine:

I have a range, B4:AD49

I want to copy the range and paste its values in another range. The upper
left hand corner of this new range would be B53 of the same worksheet. How
would I do this via VBA?

(Why am I doing this? Because this sheet is part of a larger model, and the
sheet is being used by a novice to Excel who needs only the values in the
aforementioned range. I figure copying this range and pasting its values
elsewhere on the sheet is the easiest way to idiot-proof the data. Once I
figure out how to copy and paste the values in range B4:AD49, I'll then have
the macro hide rows that don't need to be viewed by the novice user.)
--
Brevity is the soul of wit.


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default copy and paste values in a range

ok, i understand the qualifying of the ranges and do use it. i was just curious
about using, or not using, the named parameters.

--


Gary


"Dave Peterson" wrote in message
...
Absolutely nothing.

I just like to fully qualify my ranges (with worksheets(...)) and I like to
use
named parameters. And I like two lines--just for ease of reading.



Gary Keramidas wrote:

just curious, what would be wrong with just using 1 line like this?

Range("B4:AD49").Copy Range("B53")

--

Gary

"Dave Peterson" wrote in message
...
with worksheets("sheet9999")
.range("b4:ad49").copy _
destination:=.range("b53")
end with

If you really only need values:

dim RngToCopy as range
with worksheets("sheet9999")
set rngtocopy = .range("b4:ad49")
.range("b53").resize(rngtocopy.rows.count,rngtocop y.columns.count).value
_
= rngtocopy.value
end with

Or
with worksheets("sheet9999")
.range("b4:ad49").copy
.range("b53").pastespecial paste:=xlpastespecialvalues
end with



Dave F wrote:

This should be a simple VBA routine:

I have a range, B4:AD49

I want to copy the range and paste its values in another range. The upper
left hand corner of this new range would be B53 of the same worksheet.
How
would I do this via VBA?

(Why am I doing this? Because this sheet is part of a larger model, and
the
sheet is being used by a novice to Excel who needs only the values in the
aforementioned range. I figure copying this range and pasting its values
elsewhere on the sheet is the easiest way to idiot-proof the data. Once I
figure out how to copy and paste the values in range B4:AD49, I'll then
have
the macro hide rows that don't need to be viewed by the novice user.)
--
Brevity is the soul of wit.

--

Dave Peterson


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default copy and paste values in a range

I like named parms -- especially when the alternative is something like:

xxxx.yyyyy , , , , , , true, , , 0 , false, 1, 3



Gary Keramidas wrote:

ok, i understand the qualifying of the ranges and do use it. i was just curious
about using, or not using, the named parameters.

--

Gary

"Dave Peterson" wrote in message
...
Absolutely nothing.

I just like to fully qualify my ranges (with worksheets(...)) and I like to
use
named parameters. And I like two lines--just for ease of reading.



Gary Keramidas wrote:

just curious, what would be wrong with just using 1 line like this?

Range("B4:AD49").Copy Range("B53")

--

Gary

"Dave Peterson" wrote in message
...
with worksheets("sheet9999")
.range("b4:ad49").copy _
destination:=.range("b53")
end with

If you really only need values:

dim RngToCopy as range
with worksheets("sheet9999")
set rngtocopy = .range("b4:ad49")
.range("b53").resize(rngtocopy.rows.count,rngtocop y.columns.count).value
_
= rngtocopy.value
end with

Or
with worksheets("sheet9999")
.range("b4:ad49").copy
.range("b53").pastespecial paste:=xlpastespecialvalues
end with



Dave F wrote:

This should be a simple VBA routine:

I have a range, B4:AD49

I want to copy the range and paste its values in another range. The upper
left hand corner of this new range would be B53 of the same worksheet.
How
would I do this via VBA?

(Why am I doing this? Because this sheet is part of a larger model, and
the
sheet is being used by a novice to Excel who needs only the values in the
aforementioned range. I figure copying this range and pasting its values
elsewhere on the sheet is the easiest way to idiot-proof the data. Once I
figure out how to copy and paste the values in range B4:AD49, I'll then
have
the macro hide rows that don't need to be viewed by the novice user.)
--
Brevity is the soul of wit.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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 range in macro using paste special values Jeff Excel Discussion (Misc queries) 2 August 20th 07 08:12 PM
copy and paste values in a range keri Excel Programming 0 December 14th 06 06:45 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM
copy / paste values for certain range Eric Dreshfield Excel Programming 2 September 10th 03 04:04 PM


All times are GMT +1. The time now is 08:10 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"