Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Cells(r,2).Resize(1,2).Copy Cells(2+off,"F")
The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
cells(2+off,"F").Value = Cells(r,2).resize(1,2).Value
"tkraju via OfficeKB.com" wrote: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Patrick,
I changed the code,but I didn't get desired results.this has permanently cut the values from the column 2 and pasted the values in column F "Patrick Molloy" wrote: cells(2+off,"F").Value = Cells(r,2).resize(1,2).Value "tkraju via OfficeKB.com" wrote: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
well the "F" was in your code as the target cell
the correct syntax is with Source Target.Resize( .Rows.Count, .Cols.Count ).Value = .Value End With where both Source and Target are defined and set as ranges "TUNGANA KURMA RAJU" wrote: Patrick, I changed the code,but I didn't get desired results.this has permanently cut the values from the column 2 and pasted the values in column F "Patrick Molloy" wrote: cells(2+off,"F").Value = Cells(r,2).resize(1,2).Value "tkraju via OfficeKB.com" wrote: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Just a typo alert.
..cols.count should be ..columns.count Patrick Molloy wrote: well the "F" was in your code as the target cell the correct syntax is with Source Target.Resize( .Rows.Count, .Cols.Count ).Value = .Value End With where both Source and Target are defined and set as ranges "TUNGANA KURMA RAJU" wrote: Patrick, I changed the code,but I didn't get desired results.this has permanently cut the values from the column 2 and pasted the values in column F "Patrick Molloy" wrote: cells(2+off,"F").Value = Cells(r,2).resize(1,2).Value "tkraju via OfficeKB.com" wrote: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Sub extractData()
Dim sName As String Dim dDate As Date Dim Ammount As Double Dim LastRow As Long Dim off As Long LastRow = Range("A" & Rows.Count).End(xlUp).Row sName = Range("D1").Value dDate = Range("E1").Value For r = 2 To LastRow If Format(Cells(r, 2), "mm-yy") = Format(dDate, "mm-yy") Then If Cells(r, 1).Value = sName Then Cells(r, 2).Resize(1, 2).Copy Cells(2 + off, "K") Cells(r, 6).Resize(1, 2).Copy Cells(2+ off, "M") off = off + 1 End If End If Next End Sub Well this is my code.I am getting problem in that second line copying.Cells(r, 6) means Col F and G values be copied to Col M and N,where as Col F and G values formula based result values,thus I am getting different values in Col M and N. I need Contents of Col F and G are to be copied to Col M and N. "Patrick Molloy" wrote: well the "F" was in your code as the target cell the correct syntax is with Source Target.Resize( .Rows.Count, .Cols.Count ).Value = .Value End With where both Source and Target are defined and set as ranges "TUNGANA KURMA RAJU" wrote: Patrick, I changed the code,but I didn't get desired results.this has permanently cut the values from the column 2 and pasted the values in column F "Patrick Molloy" wrote: cells(2+off,"F").Value = Cells(r,2).resize(1,2).Value "tkraju via OfficeKB.com" wrote: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Hi
I think this is what you need: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F").PasteSpecial xlPasteValues Regards, Per "tkraju via OfficeKB.com" <u16627@uwe skrev i meddelelsen news:949a30b4f01c7@uwe... Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Thank you Per Jessen,
this code is yours,I think you have not seen my reply in OfficeKb. this problem is almost over,now it is pasting values only ,the bug is last row cells still in selected state, and last source(copy) cells still blinking around. "Per Jessen" wrote: Hi I think this is what you need: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F").PasteSpecial xlPasteValues Regards, Per "tkraju via OfficeKB.com" <u16627@uwe skrev i meddelelsen news:949a30b4f01c7@uwe... Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy cell values only
Hi
Haven't seen your last reply, will look at it tomorrow. Add this after the "Next" statement to turn off "marching ants": Application.CutCopyMode=False Regards, Per "TUNGANA KURMA RAJU" skrev i meddelelsen ... Thank you Per Jessen, this code is yours,I think you have not seen my reply in OfficeKb. this problem is almost over,now it is pasting values only ,the bug is last row cells still in selected state, and last source(copy) cells still blinking around. "Per Jessen" wrote: Hi I think this is what you need: Cells(r,2).Resize(1,2).Copy Cells(2+off,"F").PasteSpecial xlPasteValues Regards, Per "tkraju via OfficeKB.com" <u16627@uwe skrev i meddelelsen news:949a30b4f01c7@uwe... Cells(r,2).Resize(1,2).Copy Cells(2+off,"F") The above code copying cell values and formulas.My requirement is to copy cell values(contents) only.What changes I need to do the above code line to copy cell contents only. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200904/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy values from a cell based on values of another cell | Excel Discussion (Misc queries) | |||
Copy values to a different cell | Excel Worksheet Functions | |||
VAB to copy cell values into new Sheet, Overwrite if needed and based off of Cell Value in a column | Excel Programming | |||
copy cell values to another workbook | Excel Programming | |||
How do I copy cell values in VBA | Excel Programming |