Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA copy and paste data
Hi -
I have a spreadsheet that I am using as a database and a userform that I am using as the entry portal for the data being entered I am trying to add some VBA to the userform that will copy data in columns A-C, but only from the last row of entered data. The VBA will run when button CommandButton1 is pressed. Any help gratefully received Paul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA copy and paste data
On 07/02/2014 9:29 AM, Paul Mullan wrote:
Hi - I have a spreadsheet that I am using as a database and a userform that I am using as the entry portal for the data being entered I am trying to add some VBA to the userform that will copy data in columns A-C, but only from the last row of entered data. The VBA will run when button CommandButton1 is pressed. Any help gratefully received Paul Spreadsheets being used as a database need to be properly structured as datatables! Userforms being used as dataforms need to be properly configured to work as a dataform! If you expect reliable performance and integretyy from your project then 'willy-nilly', unfortunately, just won't 'cut it'! Can you post a download link to your project file so we can better advise you and/or provide a solution? (Please make sure the file contains some sample data, and a fully explained expectation of how you want your dataform to work!) -- - Garry Free Usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA copy and paste data
Paul Mullan wrote:
I have a spreadsheet that I am using as a database and a userform that I am using as the entry portal for the data being entered I am trying to add some VBA to the userform that will copy data in columns A-C, but only from the last row of entered data. The VBA will run when button CommandButton1 is pressed. This copies (to the clipboard) from the bottom row that has any data in any of those 3 columns: workRow = 0 lastRow = Cells.SpecialCells(xlCellTypeLastCell).Row For L0 = 1 To 3 If Len(Cells(lastRow, L0).Value) < 1 Then r1 = Cells(lastRow, L0).End(xlUp).Row Else r1 = lastRow End If If workRow < r1 Then workRow = r1 Next Range("A" & workRow & ":C" & workRow).Copy -- - They're brainwashing you, watch out. - but i'm hungry - That's what they want you to think. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA copy and paste data
I forgot to mention that Excel has a builtin dataform for exactly the
purpose of your userform! Did you try using that instead? -- - Garry Free Usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How copy none excel data & paste in 2007 without overwriting data | Excel Discussion (Misc queries) | |||
Copy and Paste LAST ROW of data | Excel Programming | |||
Copy and Paste data | Excel Programming | |||
filted data, copy and paste a col. puts data in wrong row how fix | New Users to Excel | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) |