VBA Help

erzon

New Member
Joined
Oct 19, 2017
Messages
12
How can I copy the filtered rows in a table and paste it into another table?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This assumes your data is on Sheet1 and the headings begin in A1 and you wish to copy and paste to Sheet2 cell A1

Code:
Sub copyFilt()
Sheets("Sheet1").Range("A1").CurrentRegion.Copy
Sheets("Sheet2").Range("A1").PasteSpecial xlPasteValues


End Sub
 
Upvote 0
It works but the table on the destination is gone. I need to make the value only of filtered row to be copied in the new table in other sheet
 
Upvote 0
change the destination to where you would like it to go. I cannot read your mind and know where your table is if you don't tell me. I was giving you an example of how to make this work. Amend the code to fit your needs.
 
Upvote 0
Thank you for your suggestion.
What i need is a vba that will copy a filtered Data into an existing table. For example I filtered the data in ColumnA = Apple meaning all apple data will be copied into the existing table in new sheet
 
Upvote 0
Again, if you don't tell us the location of the existing table, how can we give you code for this. We need to know the entire range of the table so that it can be appended to the table. Name of the Sheet where the table is also necessary. We unfortunately are not mind readers and cannot see your worksheet to understand exactly what you have. You need to tell us.

Also, how can you have an existing table in a new sheet. Do you mean an existing table in an existing sheet?
 
Upvote 0
I have been following this thread.
I agree the user is providing very little if any specific details.

I would think we need the name of both sheets.
And the names of Both Tables

Saying copy from Table and add to another Table is not specific at all.

The only thing you said in post one was:

How can I copy the filtered rows in a table and paste it into another table?
 
Upvote 0
Sorry about that ok

I have Table1 with data on it. So I have filter criteria base on the Table1 data. So if I filter the Table1 data i would like to copy all those filtered in Table1 and put it in Table2 last row. that's all i need how to make it in VBA

Table1 columns,
Names, Location, City and Destination

so if I filter the destination all those filtered rows should be copied into Table2 same column name
 
Upvote 0
Two of us tried to help you yesterday. But I know I was not able to get clear answers to my questions.
I would like to ask these questions and I would like a answer to each question

1. What is the name of the Two Tables.
2. Are both Tables on the same sheet.
3. Give me the name of both sheets if there are two sheets.

So you need to say something like this:

I have a Table named "Table1" on sheet named "One"
I Have a Table named "Table2" on a sheet named "Two"

Please do not say:
I have already provided those details read my previous post's
 
Upvote 0

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

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