Copy of specific data from one sheet to another

mahmoudguda29

New Member
Joined
Aug 24, 2024
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Hello guys , i have 2 sheets in the same workbook ( A & B)
I want to copy entire columns (A,C,D,E) from sheet A to sheet B excluding rows starts with (e) cell text
Plz help with a vba code 🙏
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
You forgot to specify some information.
excluding rows starts with (e) cell text
Exclude the row starting with "E" but from which column?
Or from any of the columns, that is, if there is "E" in column A or C or D or E, then exclude the row.
In which row does the data begin?
And in which cell do you want to start pasting the data?
 
Upvote 0
The "e " in column A
Pasting data in the new sheet will start at A1 cell
Screenshot_٢٠٢٤-٠٨-٢٥-٠٠-٠٧-٣٧-٨٧_439a3fec0400f8974d35eed09a31f914.jpg
 
Upvote 0
In which row does the data begin?
You still don't put in all the necessary information, but I'm going to assume that the data starts in row 2.

Try this:

VBA Code:
Sub Macro1()
  Dim lr As Long
  With Sheets("A")
    lr = .Range("A" & Rows.Count).End(3).Row
    .Range("A1:E" & lr).AutoFilter 1, "<>e"
    .Range("A1:A" & lr & ",C1:E" & lr).Copy Sheets("B").Range("A1")
    .Range("A1:E" & lr).AutoFilter
  End With
End Sub


🧙‍♂️
 
Upvote 1
Solution
Thnx alot works very fine ☺️🍀
But doesn't keep columns width ..
& What if i need to filter blank cells instead of (e) text cells?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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