Add data from table to buttom of another table

Silaws

New Member
Joined
Oct 1, 2014
Messages
14
I have a sheet "Data" with an empty table "Table1" I need a macro that retrieves everything that is in the table, it can be from one to several rows, and inserts it at the bottom of another table "Table2" in the sheet "LockedData " and then converts "Table1" so it's an empty one row table again
can anyone help me out?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Have you tried to record a macro to do this? Try that, post your code and it'll be easier to suggest a solution if it doesn't work.
 
Upvote 0
the first problem is i dont know how to get it at the bottom of the table, now it just insert where the curser is

Code:
Sub hentData()'
' hentData Makro
'


'
    Range("Tabel1").Select
    Selection.Copy
    Sheets("LåstData").Select
    Range("Tabel3").Select
    ActiveSheet.Paste
    Sheets("hentData").Select
    Range("Tabel1[Medarbejder]").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("Tabel1[Opgave]").Select
    Selection.ClearContents
    Range("Tabel1[Tid (min)]").Select
    Selection.ClearContents
    Range("Tabel1[Dato]").Select
    Selection.ClearContents
End Sub
 
Upvote 0
Based on your code, try:
Code:
Sub hentData()
' hentData Makro
'

Application.ScreenUpdating = False

Sheets("hentData").Range("Tabel1").Copy
Sheets("LåstData").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues

Application.CutCopyMode = False

With Sheets("hentData")
    .Range("Tabel1[Medarbejder]").ClearContents
    .Range("Tabel1[Opgave]").ClearContents
    .Range("Tabel1[Tid (min)]").ClearContents
    .Range("Tabel1[Dato]").ClearContents
End With

Application.ScreenUpdating = True

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,731
Messages
6,132,390
Members
449,725
Latest member
Enero1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top