![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 85
|
Hello I have a problem.
Ok I have a macro that copies data to another worksheet However I want everytime the macro copies this data to move it down to the next cell for example: One time when I copy the data from the cell 'B11' I copy it to a new worksheet to the cell 'A2' however the next time I copy the data from 'B11' want it to copy the data to 'A3' and so on |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Hi there
There are many ways to do this, but as a starter try this: On your other worksheet, in any cell not in column A (say D1) put this formula ="A"&COUNTA(A:A)+1 D4 now shows the address of the next blank cell in Column A (provided you have no gaps). First get your macro to select this sheet then select the required cell using code like this: Range(Range("D4").Value).Select Now return to you first sheet, copy your data, select the second sheet and use the code ActiveSheet.Paste. This will paste it into the cell you have previously selected hope this helps, if not use the search function here as this has come up many times regards Derek Der |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,387
|
Here's a more detailed code if you are still stuck. Modify for sheet names.
Sub CopyThis() Application.ScreenUpdating = False Sheets("Sheet1").[B11].Copy Sheets("Sheet2").Select [A65536].End(xlUp).Offset(1, 0).PasteSpecial (xlPasteAll) Application.CutCopyMode = False Sheets("Sheet1").Select Application.ScreenUpdating = True End Sub |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|