Range copy to a new worksheet

john5599

Board Regular
Joined
Mar 11, 2010
Messages
221
I have an excel file contains 8 sheet. I would like to copy full details to a new excel new file if 2 values not equel.

Suppose Cast Quantity <> Delivery then I want to copy it to a new excel file. All 8 should check then result should come with Head Lines to New File (Sheet1) one after another. I want all result of 8 sheet in New Excel file sheet 1.

Can some one to help me find the solution.
 

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
as full details (in which column these data are entered etc) it is not possible to give full solution;

if you want to loop through the sheets (you are not copying in the same workbook but in another workbook)

Code:
dim j as integer,k as integer
j=worksheets.count
for k=1 to j
worksheets(k).activate
...
(your code statements  )

next k
If you are familiar with WITH statements you can use
with worksheets(k)
this will avoid activating each sheet.

if you want to copy the data to the first empty row in another saved wokbook(e.g book2.xls) which is opened.
Code:
dim dest as range 
set dest=workbooks("book2.xls).worksheets("sheet1").cells(rows.count,"A").end(xlup).offset(1,0)
dest.pastespecial

I have not checked with any data so there may be some minor mistakes.
 

Watch MrExcel Video

Forum statistics

Threads
1,101,923
Messages
5,483,726
Members
407,406
Latest member
ishipra

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top