Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paste and Paste Special No Longer Working - Excel 2003 | Excel Discussion (Misc queries) | |||
Automating copy/paste/paste special when row references change | Excel Programming | |||
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. | Excel Worksheet Functions | |||
How do I capture user paste action and convert to Paste Special | Excel Programming | |||
Macro to Paste to specific line, and continue to Paste each time on next row not over | Excel Programming |