ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA code Help needed (https://www.excelbanter.com/excel-programming/281548-vba-code-help-needed.html)

liamothelegend

VBA code Help needed
 

Hello all I am trying to change the below macros so that the contents of
cell A3 is used and not the text which happens to be “1090-0450*BE”
(but could be any of a number of sequences).
I recorded the first using the find function in excel and the second
using the custom option in Autofilter

Somebody please show me the way as its doin my head in .

'
' Macro4 Macro
' Macro recorded 11/5/2003 by ?

'
Range("A3").Select
Selection.Copy
Cells.Find(What:="1090-0450*BE", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False).Activate
End Sub


Sub Macro5()
'
' Macro5 Macro
' Macro recorded 11/5/2003 by ?
'

'
Range("A3").Select
Selection.Copy
Selection.AutoFilter Field:=1, Criteria1:="=1520-0444*BE",
Operator:= _
xlAnd
End Sub


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


JON JON

VBA code Help needed
 

Try replacing it with: Range("A3").Value

"liamothelegend" wrote in
message ...

Hello all I am trying to change the below macros so that the contents of
cell A3 is used and not the text which happens to be "1090-0450*BE"
(but could be any of a number of sequences).
I recorded the first using the find function in excel and the second
using the custom option in Autofilter

Somebody please show me the way as its doin my head in .

'
' Macro4 Macro
' Macro recorded 11/5/2003 by ?

'
Range("A3").Select
Selection.Copy
Cells.Find(What:="1090-0450*BE", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False).Activate
End Sub


Sub Macro5()
'
' Macro5 Macro
' Macro recorded 11/5/2003 by ?
'

'
Range("A3").Select
Selection.Copy
Selection.AutoFilter Field:=1, Criteria1:="=1520-0444*BE",
Operator:= _
xlAnd
End Sub


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:40 PM.

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