From: Puzzled on
I have information in column A of a task sheet. The information goes from row
1 thru 35. Column B is where I place a "x" to say the task need to be
completed. Is there a formula that can check each row in column B to see if
the "x" exist, until it reaches the end. If the "x" exist in any of the rows,
then move the information into a blank sheet called assignment. Example
B1,B3,B4,B20 all have a "x" in the field, now I need to move the information
in A1, A3, A4, A20 to row1 thru 4 of a blank work sheet. Is this possible.
From: FSt1 on
hi
not with a formula. formulas return value to the cell in which they reside.
they can not perform actions like move data to other specific cellls. you
would have to have the formulas set up on the blank sheet to do this.
what you want smells like a macro. not sure but i whipped this out. not to
pretty but it works.
right click your first sheet and from the pop up, click view code. paste the
below in the big white box. adjust sheet names and cell references to suit.
when you enter an "x" in column b, the contents of the cell next to the x in
column A will tranfer to sheet 2 column A.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range
Set r = Range("B:B")
If Selection.Count > 1 Then
Exit Sub
End If
If Intersect(Target, r) Is Nothing Then
Exit Sub
Else
If Target.Value <> "x" Then
Exit Sub
Else
Sheets("sheet2").Range("A65000").End(xlUp).Offset(1, 0) = _
Target.Offset(0, -1)
End If
End If
End Sub

"Puzzled" wrote:

> I have information in column A of a task sheet. The information goes from row
> 1 thru 35. Column B is where I place a "x" to say the task need to be
> completed. Is there a formula that can check each row in column B to see if
> the "x" exist, until it reaches the end. If the "x" exist in any of the rows,
> then move the information into a blank sheet called assignment. Example
> B1,B3,B4,B20 all have a "x" in the field, now I need to move the information
> in A1, A3, A4, A20 to row1 thru 4 of a blank work sheet. Is this possible.
From: Puzzled on
Thank You very much

"FSt1" wrote:

> hi
> not with a formula. formulas return value to the cell in which they reside.
> they can not perform actions like move data to other specific cellls. you
> would have to have the formulas set up on the blank sheet to do this.
> what you want smells like a macro. not sure but i whipped this out. not to
> pretty but it works.
> right click your first sheet and from the pop up, click view code. paste the
> below in the big white box. adjust sheet names and cell references to suit.
> when you enter an "x" in column b, the contents of the cell next to the x in
> column A will tranfer to sheet 2 column A.
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> Dim r As Range
> Set r = Range("B:B")
> If Selection.Count > 1 Then
> Exit Sub
> End If
> If Intersect(Target, r) Is Nothing Then
> Exit Sub
> Else
> If Target.Value <> "x" Then
> Exit Sub
> Else
> Sheets("sheet2").Range("A65000").End(xlUp).Offset(1, 0) = _
> Target.Offset(0, -1)
> End If
> End If
> End Sub
>
> "Puzzled" wrote:
>
> > I have information in column A of a task sheet. The information goes from row
> > 1 thru 35. Column B is where I place a "x" to say the task need to be
> > completed. Is there a formula that can check each row in column B to see if
> > the "x" exist, until it reaches the end. If the "x" exist in any of the rows,
> > then move the information into a blank sheet called assignment. Example
> > B1,B3,B4,B20 all have a "x" in the field, now I need to move the information
> > in A1, A3, A4, A20 to row1 thru 4 of a blank work sheet. Is this possible.
From: Max on
You can use formulas to achieve the desired functionality in the new "blank"
sheet, dynamically

Assume your source data in Sheet1, in A2 down
In B2 down is where you will mark "x"

In your new "blank" sheet,
In A2: =IF(Sheet1!B2="x",ROW(),"")
In B2:
=IF(ROWS($1:1)>COUNT(A:A),"",INDEX(Sheet1!A:A,SMALL(A:A,ROWS($1:1))))
Copy A2:B2 down to cover the max expected extent of source data.
Hide/minimize col A. Col B will return the required results, all neatly
bunched at the top. voila? hit YES below. Easily modify the criteria in A2 to
suit what-you-want.
--
Max
Singapore
---
From: FSt1 on
impressive. could you break down the logic behind this formula.

regards
FSt1

"Max" wrote:

> You can use formulas to achieve the desired functionality in the new "blank"
> sheet, dynamically
>
> Assume your source data in Sheet1, in A2 down
> In B2 down is where you will mark "x"
>
> In your new "blank" sheet,
> In A2: =IF(Sheet1!B2="x",ROW(),"")
> In B2:
> =IF(ROWS($1:1)>COUNT(A:A),"",INDEX(Sheet1!A:A,SMALL(A:A,ROWS($1:1))))
> Copy A2:B2 down to cover the max expected extent of source data.
> Hide/minimize col A. Col B will return the required results, all neatly
> bunched at the top. voila? hit YES below. Easily modify the criteria in A2 to
> suit what-you-want.
> --
> Max
> Singapore
> ---