Copy specific rows

satya12

Board Regular
Joined
Oct 19, 2021
Messages
70
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

Can you please help me about this,
i am having two excel workbook one is Source and another one is macro. what i want for my rule is i want to copy visible specific rows if condition is met and paste it into another macro
i tried one code but it is copying all visible cells , but in my condition if text found copy the row value which are required , if text not found take another visible cell copy that row values.
Here i shown you sample source file

this sample source file
1635241689447.png


this is the sample file Here: In the col E "<100" text was found copy 4th row "D,F,G,H,I" col
and paste it into another workbook
Not found
copy 16th row "D,F,G,H,I" column values

this is the code which i last used in
If InStr(Range("E" & i).Value, "<100") > 0 Then
ActiveSheet.Range("D:D").SpecialCells(xlCellTypeVisible).Copy
Windows("Output file.xlsm").Activate
Worksheets("Macro").Activate
ActiveSheet.Range("E" & i).PasteSpecial Paste:=xlPasteValues

Else
ActiveSheet.Range("F:F").SpecialCells(xlCellTypeVisible).Copy
Windows("Output file.xlsm").Activate

Worksheets("Macro").Activate
ActiveSheet.Range("C:C").PasteSpecial Paste:=xlPasteValues

Application.CutCopyMode = False




please help me this
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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