+ Reply to Thread
Results 1 to 19 of 19

Identify the contents of column in a filtered range

  1. #1
    Bob Phillips
    Guest

    Re: Identify the contents of column in a filtered range

    Untested, but maybe something like this using VBA

    iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
    Set myRange = Range("B9:B" & iLastRow).SpecialCells(xlCellTypeVisible)


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    > I have a filtered range. I am trying to extract the value of the contents
    > of the cell in column B which is always immediately below cell B8. (Rows 1
    > through 8 are reserved for display data summary and KPI's and the window

    is
    > split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9"

    returns
    > either the value of the first record (when using range name) or the cell
    > value in the present filtered range being examined. The latter will vary
    > depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?
    >
    >




  2. #2
    Dave Peterson
    Guest

    Re: Identify the contents of column in a filtered range

    Is column B the second column of the filtered range? (Did you include column A
    in your filtered range?)

    If yes:

    Option Explicit
    Sub testme()

    Dim rngF As Range

    With ActiveSheet.AutoFilter.Range
    If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    'header row only
    MsgBox "No details shown. Please try again"
    Exit Sub
    End If
    Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    .Cells.SpecialCells(xlCellTypeVisible)

    MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value

    End With

    End Sub



    Jeff wrote:
    >
    > I have a filtered range. I am trying to extract the value of the contents
    > of the cell in column B which is always immediately below cell B8. (Rows 1
    > through 8 are reserved for display data summary and KPI's and the window is
    > split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9" returns
    > either the value of the first record (when using range name) or the cell
    > value in the present filtered range being examined. The latter will vary
    > depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?


    --

    Dave Peterson

  3. #3
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range

    Dave,

    Thanks for this. It works fine and yields the correct value in the message
    box.
    I would like this value to automatically display as a value in cell E2 so it
    can be used in a formula (dependant on the value in E2).

    Is it possible? Is this a big ask?

    I ereally appreciate you taking the time to solve this problem - I have
    spent hours trying all the obvious techniques (and I learn / upskill
    everytime I post).

    sincerely
    Jeff


    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Is column B the second column of the filtered range? (Did you include
    > column A
    > in your filtered range?)
    >
    > If yes:
    >
    > Option Explicit
    > Sub testme()
    >
    > Dim rngF As Range
    >
    > With ActiveSheet.AutoFilter.Range
    > If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    > 'header row only
    > MsgBox "No details shown. Please try again"
    > Exit Sub
    > End If
    > Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    > .Cells.SpecialCells(xlCellTypeVisible)
    >
    > MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value
    >
    > End With
    >
    > End Sub
    >
    >
    >
    > Jeff wrote:
    >>
    >> I have a filtered range. I am trying to extract the value of the
    >> contents
    >> of the cell in column B which is always immediately below cell B8. (Rows
    >> 1
    >> through 8 are reserved for display data summary and KPI's and the window
    >> is
    >> split and frozen Row1:Row8).
    >> Depending on the filter criteria used this row number / the cell "B9" I
    >> am
    >> trying to identify may be anything from 9 to 1200.
    >>
    >> All my attempts to "capture" the contents of the "effective cell B9"
    >> returns
    >> either the value of the first record (when using range name) or the cell
    >> value in the present filtered range being examined. The latter will vary
    >> depending on the filter criteria used.
    >>
    >> In effect, my question is, is there any way, the contents of cell Bxxx
    >> can
    >> be extracted as if it were effectively B9?

    >
    > --
    >
    > Dave Peterson




  4. #4
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range

    Bob,

    Thanks for taking the time to work on my problem. I created the suggested
    macro and reffered to it in my filtering macro but it didn't seem to do
    anything different.
    Another poster has replied with an alternative solution that extracts the
    correct info but it is in amessage box (that was my fault not saying I need
    the info in a particular cell (E2).
    I really appreciate you having taken the time to reply.
    sincerely

    Jeff

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Untested, but maybe something like this using VBA
    >
    > iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
    > Set myRange = Range("B9:B" & iLastRow).SpecialCells(xlCellTypeVisible)
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Jeff" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a filtered range. I am trying to extract the value of the
    >> contents
    >> of the cell in column B which is always immediately below cell B8. (Rows
    >> 1
    >> through 8 are reserved for display data summary and KPI's and the window

    > is
    >> split and frozen Row1:Row8).
    >> Depending on the filter criteria used this row number / the cell "B9" I
    >> am
    >> trying to identify may be anything from 9 to 1200.
    >>
    >> All my attempts to "capture" the contents of the "effective cell B9"

    > returns
    >> either the value of the first record (when using range name) or the cell
    >> value in the present filtered range being examined. The latter will vary
    >> depending on the filter criteria used.
    >>
    >> In effect, my question is, is there any way, the contents of cell Bxxx
    >> can
    >> be extracted as if it were effectively B9?
    >>
    >>

    >
    >




  5. #5
    Bob Phillips
    Guest

    Re: Identify the contents of column in a filtered range

    Option Explicit

    Sub testme()
    Dim rngF As Range

    With ActiveSheet.AutoFilter.Range
    If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    'header row only
    MsgBox "No details shown. Please try again"
    Exit Sub
    End If
    Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    .Cells.SpecialCells(xlCellTypeVisible)

    Range("E2").Value = rngF.Cells(1).Address & vbLf &
    rngF.Cells(1).Value

    End With

    End Sub



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    > Dave,
    >
    > Thanks for this. It works fine and yields the correct value in the

    message
    > box.
    > I would like this value to automatically display as a value in cell E2 so

    it
    > can be used in a formula (dependant on the value in E2).
    >
    > Is it possible? Is this a big ask?
    >
    > I ereally appreciate you taking the time to solve this problem - I have
    > spent hours trying all the obvious techniques (and I learn / upskill
    > everytime I post).
    >
    > sincerely
    > Jeff
    >
    >
    > "Dave Peterson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Is column B the second column of the filtered range? (Did you include
    > > column A
    > > in your filtered range?)
    > >
    > > If yes:
    > >
    > > Option Explicit
    > > Sub testme()
    > >
    > > Dim rngF As Range
    > >
    > > With ActiveSheet.AutoFilter.Range
    > > If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1

    Then
    > > 'header row only
    > > MsgBox "No details shown. Please try again"
    > > Exit Sub
    > > End If
    > > Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    > > .Cells.SpecialCells(xlCellTypeVisible)
    > >
    > > MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value
    > >
    > > End With
    > >
    > > End Sub
    > >
    > >
    > >
    > > Jeff wrote:
    > >>
    > >> I have a filtered range. I am trying to extract the value of the
    > >> contents
    > >> of the cell in column B which is always immediately below cell B8.

    (Rows
    > >> 1
    > >> through 8 are reserved for display data summary and KPI's and the

    window
    > >> is
    > >> split and frozen Row1:Row8).
    > >> Depending on the filter criteria used this row number / the cell "B9" I
    > >> am
    > >> trying to identify may be anything from 9 to 1200.
    > >>
    > >> All my attempts to "capture" the contents of the "effective cell B9"
    > >> returns
    > >> either the value of the first record (when using range name) or the

    cell
    > >> value in the present filtered range being examined. The latter will

    vary
    > >> depending on the filter criteria used.
    > >>
    > >> In effect, my question is, is there any way, the contents of cell Bxxx
    > >> can
    > >> be extracted as if it were effectively B9?

    > >
    > > --
    > >
    > > Dave Peterson

    >
    >




  6. #6
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range - Job Completed

    I have figured out how to use the suggested code to do the job I envisioned.

    Many thanks.

    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    >I have a filtered range. I am trying to extract the value of the contents
    >of the cell in column B which is always immediately below cell B8. (Rows 1
    >through 8 are reserved for display data summary and KPI's and the window is
    >split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9"
    > returns either the value of the first record (when using range name) or
    > the cell value in the present filtered range being examined. The latter
    > will vary depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?
    >




  7. #7
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range - Job Completed

    I have figured out how to use the suggested code to do the job I envisioned.

    Many thanks.

    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    >I have a filtered range. I am trying to extract the value of the contents
    >of the cell in column B which is always immediately below cell B8. (Rows 1
    >through 8 are reserved for display data summary and KPI's and the window is
    >split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9"
    > returns either the value of the first record (when using range name) or
    > the cell value in the present filtered range being examined. The latter
    > will vary depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?
    >




  8. #8
    Bob Phillips
    Guest

    Re: Identify the contents of column in a filtered range

    Option Explicit

    Sub testme()
    Dim rngF As Range

    With ActiveSheet.AutoFilter.Range
    If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    'header row only
    MsgBox "No details shown. Please try again"
    Exit Sub
    End If
    Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    .Cells.SpecialCells(xlCellTypeVisible)

    Range("E2").Value = rngF.Cells(1).Address & vbLf &
    rngF.Cells(1).Value

    End With

    End Sub



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    > Dave,
    >
    > Thanks for this. It works fine and yields the correct value in the

    message
    > box.
    > I would like this value to automatically display as a value in cell E2 so

    it
    > can be used in a formula (dependant on the value in E2).
    >
    > Is it possible? Is this a big ask?
    >
    > I ereally appreciate you taking the time to solve this problem - I have
    > spent hours trying all the obvious techniques (and I learn / upskill
    > everytime I post).
    >
    > sincerely
    > Jeff
    >
    >
    > "Dave Peterson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Is column B the second column of the filtered range? (Did you include
    > > column A
    > > in your filtered range?)
    > >
    > > If yes:
    > >
    > > Option Explicit
    > > Sub testme()
    > >
    > > Dim rngF As Range
    > >
    > > With ActiveSheet.AutoFilter.Range
    > > If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1

    Then
    > > 'header row only
    > > MsgBox "No details shown. Please try again"
    > > Exit Sub
    > > End If
    > > Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    > > .Cells.SpecialCells(xlCellTypeVisible)
    > >
    > > MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value
    > >
    > > End With
    > >
    > > End Sub
    > >
    > >
    > >
    > > Jeff wrote:
    > >>
    > >> I have a filtered range. I am trying to extract the value of the
    > >> contents
    > >> of the cell in column B which is always immediately below cell B8.

    (Rows
    > >> 1
    > >> through 8 are reserved for display data summary and KPI's and the

    window
    > >> is
    > >> split and frozen Row1:Row8).
    > >> Depending on the filter criteria used this row number / the cell "B9" I
    > >> am
    > >> trying to identify may be anything from 9 to 1200.
    > >>
    > >> All my attempts to "capture" the contents of the "effective cell B9"
    > >> returns
    > >> either the value of the first record (when using range name) or the

    cell
    > >> value in the present filtered range being examined. The latter will

    vary
    > >> depending on the filter criteria used.
    > >>
    > >> In effect, my question is, is there any way, the contents of cell Bxxx
    > >> can
    > >> be extracted as if it were effectively B9?

    > >
    > > --
    > >
    > > Dave Peterson

    >
    >




  9. #9
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range

    Bob,

    Thanks for taking the time to work on my problem. I created the suggested
    macro and reffered to it in my filtering macro but it didn't seem to do
    anything different.
    Another poster has replied with an alternative solution that extracts the
    correct info but it is in amessage box (that was my fault not saying I need
    the info in a particular cell (E2).
    I really appreciate you having taken the time to reply.
    sincerely

    Jeff

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Untested, but maybe something like this using VBA
    >
    > iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
    > Set myRange = Range("B9:B" & iLastRow).SpecialCells(xlCellTypeVisible)
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Jeff" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a filtered range. I am trying to extract the value of the
    >> contents
    >> of the cell in column B which is always immediately below cell B8. (Rows
    >> 1
    >> through 8 are reserved for display data summary and KPI's and the window

    > is
    >> split and frozen Row1:Row8).
    >> Depending on the filter criteria used this row number / the cell "B9" I
    >> am
    >> trying to identify may be anything from 9 to 1200.
    >>
    >> All my attempts to "capture" the contents of the "effective cell B9"

    > returns
    >> either the value of the first record (when using range name) or the cell
    >> value in the present filtered range being examined. The latter will vary
    >> depending on the filter criteria used.
    >>
    >> In effect, my question is, is there any way, the contents of cell Bxxx
    >> can
    >> be extracted as if it were effectively B9?
    >>
    >>

    >
    >




  10. #10
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range

    Dave,

    Thanks for this. It works fine and yields the correct value in the message
    box.
    I would like this value to automatically display as a value in cell E2 so it
    can be used in a formula (dependant on the value in E2).

    Is it possible? Is this a big ask?

    I ereally appreciate you taking the time to solve this problem - I have
    spent hours trying all the obvious techniques (and I learn / upskill
    everytime I post).

    sincerely
    Jeff


    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Is column B the second column of the filtered range? (Did you include
    > column A
    > in your filtered range?)
    >
    > If yes:
    >
    > Option Explicit
    > Sub testme()
    >
    > Dim rngF As Range
    >
    > With ActiveSheet.AutoFilter.Range
    > If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    > 'header row only
    > MsgBox "No details shown. Please try again"
    > Exit Sub
    > End If
    > Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    > .Cells.SpecialCells(xlCellTypeVisible)
    >
    > MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value
    >
    > End With
    >
    > End Sub
    >
    >
    >
    > Jeff wrote:
    >>
    >> I have a filtered range. I am trying to extract the value of the
    >> contents
    >> of the cell in column B which is always immediately below cell B8. (Rows
    >> 1
    >> through 8 are reserved for display data summary and KPI's and the window
    >> is
    >> split and frozen Row1:Row8).
    >> Depending on the filter criteria used this row number / the cell "B9" I
    >> am
    >> trying to identify may be anything from 9 to 1200.
    >>
    >> All my attempts to "capture" the contents of the "effective cell B9"
    >> returns
    >> either the value of the first record (when using range name) or the cell
    >> value in the present filtered range being examined. The latter will vary
    >> depending on the filter criteria used.
    >>
    >> In effect, my question is, is there any way, the contents of cell Bxxx
    >> can
    >> be extracted as if it were effectively B9?

    >
    > --
    >
    > Dave Peterson




  11. #11
    Dave Peterson
    Guest

    Re: Identify the contents of column in a filtered range

    Is column B the second column of the filtered range? (Did you include column A
    in your filtered range?)

    If yes:

    Option Explicit
    Sub testme()

    Dim rngF As Range

    With ActiveSheet.AutoFilter.Range
    If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    'header row only
    MsgBox "No details shown. Please try again"
    Exit Sub
    End If
    Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    .Cells.SpecialCells(xlCellTypeVisible)

    MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value

    End With

    End Sub



    Jeff wrote:
    >
    > I have a filtered range. I am trying to extract the value of the contents
    > of the cell in column B which is always immediately below cell B8. (Rows 1
    > through 8 are reserved for display data summary and KPI's and the window is
    > split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9" returns
    > either the value of the first record (when using range name) or the cell
    > value in the present filtered range being examined. The latter will vary
    > depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?


    --

    Dave Peterson

  12. #12
    Bob Phillips
    Guest

    Re: Identify the contents of column in a filtered range

    Untested, but maybe something like this using VBA

    iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
    Set myRange = Range("B9:B" & iLastRow).SpecialCells(xlCellTypeVisible)


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    > I have a filtered range. I am trying to extract the value of the contents
    > of the cell in column B which is always immediately below cell B8. (Rows 1
    > through 8 are reserved for display data summary and KPI's and the window

    is
    > split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9"

    returns
    > either the value of the first record (when using range name) or the cell
    > value in the present filtered range being examined. The latter will vary
    > depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?
    >
    >




  13. #13
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range - Job Completed

    I have figured out how to use the suggested code to do the job I envisioned.

    Many thanks.

    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    >I have a filtered range. I am trying to extract the value of the contents
    >of the cell in column B which is always immediately below cell B8. (Rows 1
    >through 8 are reserved for display data summary and KPI's and the window is
    >split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9"
    > returns either the value of the first record (when using range name) or
    > the cell value in the present filtered range being examined. The latter
    > will vary depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?
    >




  14. #14
    Bob Phillips
    Guest

    Re: Identify the contents of column in a filtered range

    Option Explicit

    Sub testme()
    Dim rngF As Range

    With ActiveSheet.AutoFilter.Range
    If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    'header row only
    MsgBox "No details shown. Please try again"
    Exit Sub
    End If
    Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    .Cells.SpecialCells(xlCellTypeVisible)

    Range("E2").Value = rngF.Cells(1).Address & vbLf &
    rngF.Cells(1).Value

    End With

    End Sub



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    > Dave,
    >
    > Thanks for this. It works fine and yields the correct value in the

    message
    > box.
    > I would like this value to automatically display as a value in cell E2 so

    it
    > can be used in a formula (dependant on the value in E2).
    >
    > Is it possible? Is this a big ask?
    >
    > I ereally appreciate you taking the time to solve this problem - I have
    > spent hours trying all the obvious techniques (and I learn / upskill
    > everytime I post).
    >
    > sincerely
    > Jeff
    >
    >
    > "Dave Peterson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Is column B the second column of the filtered range? (Did you include
    > > column A
    > > in your filtered range?)
    > >
    > > If yes:
    > >
    > > Option Explicit
    > > Sub testme()
    > >
    > > Dim rngF As Range
    > >
    > > With ActiveSheet.AutoFilter.Range
    > > If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1

    Then
    > > 'header row only
    > > MsgBox "No details shown. Please try again"
    > > Exit Sub
    > > End If
    > > Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    > > .Cells.SpecialCells(xlCellTypeVisible)
    > >
    > > MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value
    > >
    > > End With
    > >
    > > End Sub
    > >
    > >
    > >
    > > Jeff wrote:
    > >>
    > >> I have a filtered range. I am trying to extract the value of the
    > >> contents
    > >> of the cell in column B which is always immediately below cell B8.

    (Rows
    > >> 1
    > >> through 8 are reserved for display data summary and KPI's and the

    window
    > >> is
    > >> split and frozen Row1:Row8).
    > >> Depending on the filter criteria used this row number / the cell "B9" I
    > >> am
    > >> trying to identify may be anything from 9 to 1200.
    > >>
    > >> All my attempts to "capture" the contents of the "effective cell B9"
    > >> returns
    > >> either the value of the first record (when using range name) or the

    cell
    > >> value in the present filtered range being examined. The latter will

    vary
    > >> depending on the filter criteria used.
    > >>
    > >> In effect, my question is, is there any way, the contents of cell Bxxx
    > >> can
    > >> be extracted as if it were effectively B9?

    > >
    > > --
    > >
    > > Dave Peterson

    >
    >




  15. #15
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range

    Bob,

    Thanks for taking the time to work on my problem. I created the suggested
    macro and reffered to it in my filtering macro but it didn't seem to do
    anything different.
    Another poster has replied with an alternative solution that extracts the
    correct info but it is in amessage box (that was my fault not saying I need
    the info in a particular cell (E2).
    I really appreciate you having taken the time to reply.
    sincerely

    Jeff

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Untested, but maybe something like this using VBA
    >
    > iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
    > Set myRange = Range("B9:B" & iLastRow).SpecialCells(xlCellTypeVisible)
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Jeff" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a filtered range. I am trying to extract the value of the
    >> contents
    >> of the cell in column B which is always immediately below cell B8. (Rows
    >> 1
    >> through 8 are reserved for display data summary and KPI's and the window

    > is
    >> split and frozen Row1:Row8).
    >> Depending on the filter criteria used this row number / the cell "B9" I
    >> am
    >> trying to identify may be anything from 9 to 1200.
    >>
    >> All my attempts to "capture" the contents of the "effective cell B9"

    > returns
    >> either the value of the first record (when using range name) or the cell
    >> value in the present filtered range being examined. The latter will vary
    >> depending on the filter criteria used.
    >>
    >> In effect, my question is, is there any way, the contents of cell Bxxx
    >> can
    >> be extracted as if it were effectively B9?
    >>
    >>

    >
    >




  16. #16
    Jeff
    Guest

    Re: Identify the contents of column in a filtered range

    Dave,

    Thanks for this. It works fine and yields the correct value in the message
    box.
    I would like this value to automatically display as a value in cell E2 so it
    can be used in a formula (dependant on the value in E2).

    Is it possible? Is this a big ask?

    I ereally appreciate you taking the time to solve this problem - I have
    spent hours trying all the obvious techniques (and I learn / upskill
    everytime I post).

    sincerely
    Jeff


    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Is column B the second column of the filtered range? (Did you include
    > column A
    > in your filtered range?)
    >
    > If yes:
    >
    > Option Explicit
    > Sub testme()
    >
    > Dim rngF As Range
    >
    > With ActiveSheet.AutoFilter.Range
    > If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    > 'header row only
    > MsgBox "No details shown. Please try again"
    > Exit Sub
    > End If
    > Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    > .Cells.SpecialCells(xlCellTypeVisible)
    >
    > MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value
    >
    > End With
    >
    > End Sub
    >
    >
    >
    > Jeff wrote:
    >>
    >> I have a filtered range. I am trying to extract the value of the
    >> contents
    >> of the cell in column B which is always immediately below cell B8. (Rows
    >> 1
    >> through 8 are reserved for display data summary and KPI's and the window
    >> is
    >> split and frozen Row1:Row8).
    >> Depending on the filter criteria used this row number / the cell "B9" I
    >> am
    >> trying to identify may be anything from 9 to 1200.
    >>
    >> All my attempts to "capture" the contents of the "effective cell B9"
    >> returns
    >> either the value of the first record (when using range name) or the cell
    >> value in the present filtered range being examined. The latter will vary
    >> depending on the filter criteria used.
    >>
    >> In effect, my question is, is there any way, the contents of cell Bxxx
    >> can
    >> be extracted as if it were effectively B9?

    >
    > --
    >
    > Dave Peterson




  17. #17
    Dave Peterson
    Guest

    Re: Identify the contents of column in a filtered range

    Is column B the second column of the filtered range? (Did you include column A
    in your filtered range?)

    If yes:

    Option Explicit
    Sub testme()

    Dim rngF As Range

    With ActiveSheet.AutoFilter.Range
    If .Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count = 1 Then
    'header row only
    MsgBox "No details shown. Please try again"
    Exit Sub
    End If
    Set rngF = .Columns(2).Resize(.Rows.Count - 1, 1).Offset(1, 0) _
    .Cells.SpecialCells(xlCellTypeVisible)

    MsgBox rngF.Cells(1).Address & vbLf & rngF.Cells(1).Value

    End With

    End Sub



    Jeff wrote:
    >
    > I have a filtered range. I am trying to extract the value of the contents
    > of the cell in column B which is always immediately below cell B8. (Rows 1
    > through 8 are reserved for display data summary and KPI's and the window is
    > split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9" returns
    > either the value of the first record (when using range name) or the cell
    > value in the present filtered range being examined. The latter will vary
    > depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?


    --

    Dave Peterson

  18. #18
    Bob Phillips
    Guest

    Re: Identify the contents of column in a filtered range

    Untested, but maybe something like this using VBA

    iLastRow = Cells(Rows.Count,"B").End(xlUp).Row
    Set myRange = Range("B9:B" & iLastRow).SpecialCells(xlCellTypeVisible)


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jeff" <[email protected]> wrote in message
    news:[email protected]...
    > I have a filtered range. I am trying to extract the value of the contents
    > of the cell in column B which is always immediately below cell B8. (Rows 1
    > through 8 are reserved for display data summary and KPI's and the window

    is
    > split and frozen Row1:Row8).
    > Depending on the filter criteria used this row number / the cell "B9" I am
    > trying to identify may be anything from 9 to 1200.
    >
    > All my attempts to "capture" the contents of the "effective cell B9"

    returns
    > either the value of the first record (when using range name) or the cell
    > value in the present filtered range being examined. The latter will vary
    > depending on the filter criteria used.
    >
    > In effect, my question is, is there any way, the contents of cell Bxxx can
    > be extracted as if it were effectively B9?
    >
    >




  19. #19
    Jeff
    Guest

    Identify the contents of column in a filtered range

    I have a filtered range. I am trying to extract the value of the contents
    of the cell in column B which is always immediately below cell B8. (Rows 1
    through 8 are reserved for display data summary and KPI's and the window is
    split and frozen Row1:Row8).
    Depending on the filter criteria used this row number / the cell "B9" I am
    trying to identify may be anything from 9 to 1200.

    All my attempts to "capture" the contents of the "effective cell B9" returns
    either the value of the first record (when using range name) or the cell
    value in the present filtered range being examined. The latter will vary
    depending on the filter criteria used.

    In effect, my question is, is there any way, the contents of cell Bxxx can
    be extracted as if it were effectively B9?



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1