Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I currently use the following macro:
Selection.AutoFilter Field:=1, Criteria1:="<" How can I change thus macro so that the "1"in field would be changed to the cell that is selected. (IE how do I capture the cell where the cursor is located when I run this macro In visual basic the code would be something like: d$=celladdress Field=d$ Thanks |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]() pcor wrote: I currently use the following macro: Selection.AutoFilter Field:=1, Criteria1:="<" How can I change thus macro so that the "1"in field would be changed to the cell that is selected. (IE how do I capture the cell where the cursor is located when I run this macro In visual basic the code would be something like: d$=celladdress Field=d$ Thanks Try: Selection.AutoFilter Field:=Application.ActiveCell,Criteria1:="<" |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
How about something like:
Option Explicit Sub testme() Dim myCol As Long With ActiveSheet If Intersect(.AutoFilter.Range, ActiveCell) Is Nothing Then Beep Exit Sub End If myCol = ActiveCell.Column - .AutoFilter.Range.Column + 1 .AutoFilter.Range.AutoFilter Field:=myCol, Criteria1:="<" End With End Sub pcor wrote: I currently use the following macro: Selection.AutoFilter Field:=1, Criteria1:="<" How can I change thus macro so that the "1"in field would be changed to the cell that is selected. (IE how do I capture the cell where the cursor is located when I run this macro In visual basic the code would be something like: d$=celladdress Field=d$ Thanks -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
pcor
Selection.AutoFilter Field:=ActiveCell.Column, Criteria1:="<" Gord Dibben MS Excel MVP On Wed, 20 Sep 2006 14:34:02 -0700, pcor wrote: I currently use the following macro: Selection.AutoFilter Field:=1, Criteria1:="<" How can I change thus macro so that the "1"in field would be changed to the cell that is selected. (IE how do I capture the cell where the cursor is located when I run this macro In visual basic the code would be something like: d$=celladdress Field=d$ Thanks |
#5
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
My thanks to Mark, Dave and Gord for your efforts.
Much appreciated. "pcor" wrote: I currently use the following macro: Selection.AutoFilter Field:=1, Criteria1:="<" How can I change thus macro so that the "1"in field would be changed to the cell that is selected. (IE how do I capture the cell where the cursor is located when I run this macro In visual basic the code would be something like: d$=celladdress Field=d$ Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions |