Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will copy from Sheet1 cell D10 to Sheet2 first available cell in column B:
Sub CopyDemo() Dim s1 As Worksheet, s2 As Worksheet Dim rSource As Range, rDest As Range Set s1 = Worksheets("Sheet1") Set s2 = Worksheets("Sheet2") Set rSource = s1.Range("D10") n = s2.Cells(Rows.Count, 2).End(xlUp).Row + 1 Set rDest = s2.Range("B" & n) rSource.Copy rDest End Sub -- Gary''s Student - gsnu200909 "Talat via OfficeKB.com" wrote: Hi, Can anybody help me with this? I recorded a macro which copies cells value from one open excel file into another excel file where it needs to find the lasy used row, and then copy into cells in the row below it. But the resultant VBA code references actual cell values eg Range("A15658").Select which does not work because next time the macro is run it should be +1 steps might be open worksheet a and Sheets Copy from sheetA, row 10, columnB to worksheetB last used row+1, column A Copy from sheetA, row 10, columnD to worksheetB last used row+1, column B ..... etc Once I sort this out, I have one more query. If I can't sort it out myself, would like to get back to you or the forum again. Many thanks. Talât -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200912/1 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VAB to copy cell values into new Sheet, Overwrite if needed and based off of Cell Value in a column | Excel Programming | |||
VBA code to copy cell contents from one sheet to another | Excel Worksheet Functions | |||
code to FIND value, copy, paste values onto other sheet | Excel Programming | |||
copy values generated by conditional formula in one sheet to the other work sheet as values | Excel Worksheet Functions | |||
How do I automatically copy cell values from one sheet to another? | Excel Programming |