![]() |
Copy data not format
Hi there all
I have got thsi to work now: Private Sub CommandButton1_Click() Range("D18").Copy Destination:=Worksheets("Custome Details").Range("C18") Range("A1").ClearContents End Sub byut i only want it to copy the data not the format of the cell i wan it to use the format that is already there, any ideas? cheers from C -- Message posted from http://www.ExcelForum.com |
Copy data not format
Hi
try Private Sub CommandButton1_Click() Range("D18").Copy Worksheets("Customer Details").Range("C18").PasteSpecial Paste:=xlPasteValues Range("A1").ClearContents end sub Frank Hi there all I have got thsi to work now: Private Sub CommandButton1_Click() Range("D18").Copy Destination:=Worksheets("Customer Details").Range("C18") Range("A1").ClearContents End Sub byut i only want it to copy the data not the format of the cell i want it to use the format that is already there, any ideas? cheers from CK --- Message posted from http://www.ExcelForum.com/ |
re Copy data not format
use
Range("D18").Copy Worksheets("Customer Details").Range("C18") _ .PasteSpecial xlPasteValues Kevin Beckham -----Original Message----- Hi there all I have got thsi to work now: Private Sub CommandButton1_Click() Range("D18").Copy Destination:=Worksheets("Customer Details").Range("C18") Range("A1").ClearContents End Sub byut i only want it to copy the data not the format of the cell i want it to use the format that is already there, any ideas? cheers from CK --- Message posted from http://www.ExcelForum.com/ . |
Copy data not format
I do it like:
Range("D18").Copy Range("C18").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False HTH Ed "cakonopka " wrote in message ... Hi there all I have got thsi to work now: Private Sub CommandButton1_Click() Range("D18").Copy Destination:=Worksheets("Customer Details").Range("C18") Range("A1").ClearContents End Sub byut i only want it to copy the data not the format of the cell i want it to use the format that is already there, any ideas? cheers from CK --- Message posted from http://www.ExcelForum.com/ |
Copy data not format
Hi there
Says there is a problem with the Paste:=xlPasteValues any ideas what? says something mainly about the := bit cheers from C -- Message posted from http://www.ExcelForum.com |
Copy data not format
Hi there
I have got to this stage Private Sub CommandButton1_Click() Range("D18").Copy Worksheets("Customer Details").Range("C18").Select Selection.PasteSpecial , Paste:=xlValues, Operation:=xlNone, SkipBlanks:=xlNone Range("D18").ClearContents End Sub the only thing is it doesent work when i enter the different worksheet bit as u can see above, after the copy bit, nay idea why? cheers from CK --- Message posted from http://www.ExcelForum.com/ |
Copy data not format
One way:
Worksheets("Customer Details").Range("C18").Value = _ Range("D18").Value In article , cakonopka wrote: Hi there all I have got thsi to work now: Private Sub CommandButton1_Click() Range("D18").Copy Destination:=Worksheets("Customer Details").Range("C18") Range("A1").ClearContents End Sub byut i only want it to copy the data not the format of the cell i want it to use the format that is already there, any ideas? cheers from CK --- Message posted from http://www.ExcelForum.com/ |
Copy data not format
HI THERE ALL
HERE IS WHER I AM AT THE MONENT Private Sub CommandButton1_Click() Range("D16").Copy Worksheets("Customer Details").Range("B18").Value = _ Range("D16").Value I HAVE A SERIES OF THESE FOR THE CELLS SO WHEN I PRESS THE BUTTON AL THE DATA GOES INTO THE TABLE ALL I NEED IT TO DO NOW IS TO ADD A NEW ROW IN A T THE TOP AND MOVE TH OTHER DATA DOWN SO THE NEXT DATA IS INSERTED INTO THE NEW ROW, AN IDEAS ON THIS LAST PROBLEM THEN ILL BE SO KIND AS TO LEAVE U VER CLEVER PEOPLE ALONE, LOL CHEERS FROM C -- Message posted from http://www.ExcelForum.com |
Copy data not format
If you can, re-write to avoid using Select or ActiveCell
in your code It will run faster and with fewer errors (because you'll explicitly point to the cells being operated upon). For instance, in your code Range("D18").Copy will be that cell on the active sheet. If you change sheets then the cell now points to the new active sheet Worksheets("Customer Details").Range("C18").Select fails because that sheet is not active Either put Worksheets("Customer Details").Activate before it, or (MUCH, MUCH better) Worksheets("Customer Details").Range("C18") _ .PasteSpecial , Paste:=xlValues, Operation:=xlNone, _ SkipBlanks:=xlNone This line references the cell without activating the sheet Kevin Beckham -----Original Message----- Hi there I have got to this stage Private Sub CommandButton1_Click() Range("D18").Copy Worksheets("Customer Details").Range("C18").Select Selection.PasteSpecial , Paste:=xlValues, Operation:=xlNone, SkipBlanks:=xlNone Range("D18").ClearContents End Sub the only thing is it doesent work when i enter the different worksheet bit as u can see above, after the copy bit, nay idea why? cheers from CK --- Message posted from http://www.ExcelForum.com/ . |
Copy data not format
Worksheets("Customer Details").Range
("B18").EntireRow.Insert Worksheets("Customer Details").Range("B18").Value = _ Range("D16").Value no need to copy the cell with the code above. Kevin Beckham -----Original Message----- HI THERE ALL HERE IS WHER I AM AT THE MONENT Private Sub CommandButton1_Click() Range("D16").Copy Worksheets("Customer Details").Range("B18").Value = _ Range("D16").Value I HAVE A SERIES OF THESE FOR THE CELLS SO WHEN I PRESS THE BUTTON ALL THE DATA GOES INTO THE TABLE ALL I NEED IT TO DO NOW IS TO ADD A NEW ROW IN A T THE TOP AND MOVE THE OTHER DATA DOWN SO THE NEXT DATA IS INSERTED INTO THE NEW ROW, ANY IDEAS ON THIS LAST PROBLEM THEN ILL BE SO KIND AS TO LEAVE U VERY CLEVER PEOPLE ALONE, LOL CHEERS FROM CK --- Message posted from http://www.ExcelForum.com/ . |
All times are GMT +1. The time now is 09:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com