Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Paste just the Value

Using the code below, is there a way to paste special just the value,
and not the formatting.
I have the below taking data from Sheet (DATA) and pasting it in Sheet
(LOG). Right now it pastes the borders, value, and formatting.

Sub test()
With Worksheets("LOG")
Worksheets("DATA").Range("FULLNAME").Copy _
Destination:=.Cells(Rows.Count, 1).End(xlUp)(2)
Worksheets("DATA").Range("DEPT").Copy _
Destination:=.Cells(Rows.Count, 2).End(xlUp)(2)
End With
End Sub

Bull
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Paste just the Value

Sub test()
With Worksheets("LOG")

'copy|paste special|values in code
'and I like .offset(1,0) better than (2)
Worksheets("DATA").Range("FULLNAME").Copy
.cells(.rows.count,1).end(xlup).offset(1,0).pastes pecial paste:=xlpastevalues

....

End Sub



Bull wrote:

Using the code below, is there a way to paste special just the value,
and not the formatting.
I have the below taking data from Sheet (DATA) and pasting it in Sheet
(LOG). Right now it pastes the borders, value, and formatting.

Sub test()
With Worksheets("LOG")
Worksheets("DATA").Range("FULLNAME").Copy _
Destination:=.Cells(Rows.Count, 1).End(xlUp)(2)
Worksheets("DATA").Range("DEPT").Copy _
Destination:=.Cells(Rows.Count, 2).End(xlUp)(2)
End With
End Sub

Bull


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste just the Value

You could try it this way...

Sub test()
With Worksheets("Sheet2")
.Cells(Rows.Count, 1).End(xlUp)(2) = _
Worksheets("Sheet1").Range("FULLNAME")
.Cells(Rows.Count, 2).End(xlUp)(2) = _
Worksheets("Sheet1").Range("DEPT")
End With
End Sub

Note: Line continuations used to avoid your newsreader from splitting the
two lines in the With/EndWith block at odd locations.

Rick


"Bull" wrote in message
...
Using the code below, is there a way to paste special just the value,
and not the formatting.
I have the below taking data from Sheet (DATA) and pasting it in Sheet
(LOG). Right now it pastes the borders, value, and formatting.

Sub test()
With Worksheets("LOG")
Worksheets("DATA").Range("FULLNAME").Copy _
Destination:=.Cells(Rows.Count, 1).End(xlUp)(2)
Worksheets("DATA").Range("DEPT").Copy _
Destination:=.Cells(Rows.Count, 2).End(xlUp)(2)
End With
End Sub

Bull


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste just the Value

Actually, I rushed the answer I posted... while not necessary because it is
the "default property", I do not like to rely on default properties and
meant to 'tack on' the .Value reference to those statements...

Sub test()
With Worksheets("Sheet2")
.Cells(Rows.Count, 1).End(xlUp)(2).Value = _
Worksheets("Sheet1").Range("FULLNAME").Value
.Cells(Rows.Count, 2).End(xlUp)(2).Value = _
Worksheets("Sheet1").Range("DEPT").Value
End With
End Sub

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
You could try it this way...

Sub test()
With Worksheets("Sheet2")
.Cells(Rows.Count, 1).End(xlUp)(2) = _
Worksheets("Sheet1").Range("FULLNAME")
.Cells(Rows.Count, 2).End(xlUp)(2) = _
Worksheets("Sheet1").Range("DEPT")
End With
End Sub

Note: Line continuations used to avoid your newsreader from splitting the
two lines in the With/EndWith block at odd locations.

Rick


"Bull" wrote in message
...
Using the code below, is there a way to paste special just the value,
and not the formatting.
I have the below taking data from Sheet (DATA) and pasting it in Sheet
(LOG). Right now it pastes the borders, value, and formatting.

Sub test()
With Worksheets("LOG")
Worksheets("DATA").Range("FULLNAME").Copy _
Destination:=.Cells(Rows.Count, 1).End(xlUp)(2)
Worksheets("DATA").Range("DEPT").Copy _
Destination:=.Cells(Rows.Count, 2).End(xlUp)(2)
End With
End Sub

Bull



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Paste just the Value

On Jun 25, 9:44*am, "Rick Rothstein \(MVP - VB\)"
wrote:
Actually, I rushed the answer I posted... while not necessary because it is
the "default property", I do not like to rely on default properties and
meant to 'tack on' the .Value reference to those statements...

Sub test()
* With Worksheets("Sheet2")
* * .Cells(Rows.Count, 1).End(xlUp)(2).Value = _
* * * * * * * * * * * * * Worksheets("Sheet1").Range("FULLNAME").Value
* * .Cells(Rows.Count, 2).End(xlUp)(2).Value = _
* * * * * * * * * * * * * Worksheets("Sheet1").Range("DEPT").Value
* End With
End Sub

Rick

"Rick Rothstein (MVP - VB)" wrote in
. ..



You could try it this way...


Sub test()
*With Worksheets("Sheet2")
* *.Cells(Rows.Count, 1).End(xlUp)(2) = _
* * * * * * * * * * * * *Worksheets("Sheet1")..Range("FULLNAME")
* *.Cells(Rows.Count, 2).End(xlUp)(2) = _
* * * * * * * * * * * * *Worksheets("Sheet1")..Range("DEPT")
*End With
End Sub


Note: Line continuations used to avoid your newsreader from splitting the
two lines in the With/EndWith block at odd locations.


Rick


"Bull" wrote in message
....
Using the code below, is there a way to paste special just the value,
and not the formatting.
I have the below taking data from Sheet (DATA) and pasting it in Sheet
(LOG). *Right now it pastes the borders, value, and formatting.


Sub test()
With Worksheets("LOG")
*Worksheets("DATA").Range("FULLNAME").Copy _
* *Destination:=.Cells(Rows.Count, 1).End(xlUp)(2)
*Worksheets("DATA").Range("DEPT").Copy _
* *Destination:=.Cells(Rows.Count, 2).End(xlUp)(2)
End With
End Sub


Bull- Hide quoted text -


- Show quoted text -


Thanks a lot guys...Appreciate the help. Bull
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
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
Automating copy/paste/paste special when row references change Carl LaFong Excel Programming 4 October 8th 07 06:10 AM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
How do I capture user paste action and convert to Paste Special DonC Excel Programming 0 November 19th 04 01:43 PM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM


All times are GMT +1. The time now is 02:09 AM.

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

About Us

"It's about Microsoft Excel"