MikeRetyred
New Member
- Joined
- May 18, 2019
- Messages
- 11
Hi,
My project is to create an Excel Personal Accounts WorkBook to replace MS Money.
I'm using a Apple Mac Mini with Office 365 - OK with Excel, very new to VBA, so I'm mostly adapting recorded macros. in my 80th year this is challenging - simplicity is key
Project Summary:
Sheet 1: "TransTable" - a 'flat' table containing all transactions
Sheet 2: "Reconcile" - containing transactions selected from Sheet 1 using the Advance Filter to be analysed/reconciled.
A Count value in Sheet 1 "A1" holds the number of rows / transactions.
Question:
How can I create a Variable to use in the Advanced Filter Range.
My Code so far:
Sub AdvancedFilterTest()
'
' AdvancedFilterTest Macro
'I have tried various ways to create a Variable - as below
'Dim rg As Range
'Set rg = Worksheets("TransTable").Range("B2").CurrentRegion
' but to no avail
'Advanced Filter Recorded Code
Sheets("Reconcile").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Sheets("TransTable").Range("B2:M172").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("TransTable").Range("U2:U3"), CopyToRange:=Range( _
"B2:M2"), Unique:=False
End Sub
Many thanks in advance.
Mike
My project is to create an Excel Personal Accounts WorkBook to replace MS Money.
I'm using a Apple Mac Mini with Office 365 - OK with Excel, very new to VBA, so I'm mostly adapting recorded macros. in my 80th year this is challenging - simplicity is key
Project Summary:
Sheet 1: "TransTable" - a 'flat' table containing all transactions
Sheet 2: "Reconcile" - containing transactions selected from Sheet 1 using the Advance Filter to be analysed/reconciled.
A Count value in Sheet 1 "A1" holds the number of rows / transactions.
Question:
How can I create a Variable to use in the Advanced Filter Range.
My Code so far:
Sub AdvancedFilterTest()
'
' AdvancedFilterTest Macro
'I have tried various ways to create a Variable - as below
'Dim rg As Range
'Set rg = Worksheets("TransTable").Range("B2").CurrentRegion
' but to no avail
'Advanced Filter Recorded Code
Sheets("Reconcile").Select
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Sheets("TransTable").Range("B2:M172").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("TransTable").Range("U2:U3"), CopyToRange:=Range( _
"B2:M2"), Unique:=False
End Sub
Many thanks in advance.
Mike