ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I coppy a range from 1 sheet to another via IF statement (https://www.excelbanter.com/excel-programming/396737-how-do-i-coppy-range-1-sheet-another-via-if-statement.html)

Johnson

How do I coppy a range from 1 sheet to another via IF statement
 
In sheet 1 colom A to N I made some formulas.
In colom O I need a condition to be entered , either a Y or a N ( Yes or No ).
In sheet 2 I want to use an if statement to coppy range A to N from sheet 1,
if the condition is Y in the if statement.

I need to do this for a number of rows

The purpose of this program is to make a printable coppy on sheet 2 of all
the items that I chose in sheet one.


I use office XP pro

Damon Longworth

How do I coppy a range from 1 sheet to another via IF statement
 
In sheet 1 add an autofilter. Filter on column O for all Y's. Now print
sheet 1. No need to use another sheet or copy to another range.

If you want code, record this process.

--

Damon Longworth

2007 Excel / Access User Conference
London, England - Currently rescheduled
St. Louis, Missouri - Oct 24-26, 2007
www.ExcelUserConference.com/


"johnson" wrote in message
...
In sheet 1 colom A to N I made some formulas.
In colom O I need a condition to be entered , either a Y or a N ( Yes or
No ).
In sheet 2 I want to use an if statement to coppy range A to N from sheet 1,
if the condition is Y in the if statement.

I need to do this for a number of rows

The purpose of this program is to make a printable coppy on sheet 2 of all
the items that I chose in sheet one.


I use office XP pro



p45cal[_50_]

How do I coppy a range from 1 sheet to another via IF statement
 
You could do it with If statements but if you just want "to make a printable
copy ~ of all the items that I chose in sheet one" then you might find it
easier to select any cell in your table, go to the menu toolbar and
Data|Filter|Autofilter
You should see the top (hopefully header) row with a lot of drop down menus.
Go to the one in column O and click on the down arrow and click on 'Y'.
You should now have a filtered list, which you can print out as you see it -
if necessary selecting the table and choosing Print|checking the 'Selection'
radio button, then OK.

If statements on sheet2 is a possible solution too, but complicated.

If you must have things on Sheet2 then vba solution is to run the following
macro after selecting any single block of cells in the table, as long as the
top and bottom rows of your selection are in the right place:
Sub blah()
With Sheets("Sheet1")
For rw = Selection.Row To Selection.Row + Selection.Rows.Count - 1
If .Cells(rw, "O") = "Y" Then
Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(, 14) = _
.Cells(rw, 1).Resize(, 14).Value
End If
Next rw
End With
End Sub

--
p45cal


"johnson" wrote:

In sheet 1 colom A to N I made some formulas.
In colom O I need a condition to be entered , either a Y or a N ( Yes or No ).
In sheet 2 I want to use an if statement to coppy range A to N from sheet 1,
if the condition is Y in the if statement.

I need to do this for a number of rows

The purpose of this program is to make a printable coppy on sheet 2 of all
the items that I chose in sheet one.


I use office XP pro



All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com