Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jeff
 
Posts: n/a
Default 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?


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

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" wrote in message
...
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?




  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

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   Report Post  
Jeff
 
Posts: n/a
Default

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" wrote in message
...
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



  #5   Report Post  
Jeff
 
Posts: n/a
Default

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" wrote in message
...
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" wrote in message
...
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?








  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

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" wrote in message
...
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" wrote in message
...
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





  #7   Report Post  
Jeff
 
Posts: n/a
Default

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

Many thanks.

"Jeff" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
How do I reference every "n" cell in a column in Excel? Alma Excel Worksheet Functions 2 March 22nd 05 06:19 PM
How can I sort an entire spreadsheet from a list prod sorter Excel Worksheet Functions 4 November 17th 04 03:43 AM
Copying the contents of a column into a chart Richard Excel Worksheet Functions 1 November 16th 04 02:39 PM


All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"