Link to home
Start Free TrialLog in
Avatar of James0903
James0903

asked on

Help with Updating a Current Macro

Dear Sir/Madam,  in the attached spreadsheet, I have a Macro that was designed that is not running exactly the way I need it be run.  The Macro copies data from one tab, based upon a value, into the corresponding tabs.  In the attached spreadsheet, on the "EE Help Needed" tab, I have explained what is going on and what I need it to do.  I have also copied the Macro code into a Word document since I recall when I load the spreadsheet the Macro code does not load up with it.  Thank you very much for your time and expertise!   James.
Experts-Exchange-Question-012714.xlsm
Macro-Code-for-Experts-Exchange-.docx
Avatar of Rartemass
Rartemass
Flag of Australia image

I've taken a quick look at the code for NonFSAEligible.
I have tested the code as is and then commented out the lines that deal with the Non eligible stuff and ran again. The results look fine to me. Please test and let me know if it's OK.

Here is the updated file. Experts-Exchange-Question-012714.xlsm

The lines I commented out are below. Each line starting with an apostrophe (') will not run.

  
        'Create Not Reimbursable worksheet if it doesn't already exist
    'On Error Resume Next
    'Set NonFSAEligible = myWkb.Sheets("Non-FSA Eligible")
   ' If NonFSAEligible Is Nothing Then
    '   Set NonFSAEligible = myWkb.Worksheets.Add(after:=myWkb.Worksheets(myWkb.Worksheets.Count))
     '   NonFSAEligible.Name = "Non-FSA Eligible"
    'End If
    'NonFSAEligible.UsedRange.ClearContents
    'On Error GoTo 0
    With myInSht
        Set rg = .Range("A1").CurrentRegion
        rg.AutoFilter
        rg.AutoFilter Field:=13, Criteria1:="<>"
        'rg.Copy NonFSAEligible.Cells(1, 1)
        rg.AutoFilter Field:=13, Criteria1:=""
        'NonFSAEligible.UsedRange.EntireColumn.AutoFit
    End With

Open in new window

Avatar of James0903
James0903

ASKER

Rartemass, thank you.  The code works not to create the Non-FSA Eligible tab.  Will you be able to perform the other steps I outlined on the "EE Help Needed", rows 19-27?  Thank you.   Update spreadsheet attached.
TEST-2013-Medical-Expenses-TEST.xlsm
For the total in each tab, where would you like the total? The simplest place is at the top of the sheet and have it already present. This way the macro doesn't need further coding for that step.
This is basically what I mean:
User generated image
I'll have a look at number 3 tomorrow as I've been flat out today and haven't had a chance to address this.
Rartemass, yes, total on top is good with me.  Thank you.
Sorry I've been absent for a few days, I've been quite busy. I'll look into this again on Monday unless someone else beats me to it.
Sounds good, thank you.
Is this what you are after?
TEST-2013-Medical-Expenses-TEST.xlsm

Sorry it took so long but it has been a hellish week at work.
Rartemass, same here.  My little one is under the weather which is why it took me a few days to get back to you.  My apologies.

In regards to the file, I'm sorry, I do not see any differences.  Am I missing something?  Example: I ran the macro and on the 'Facility' tab there are rows containing 'Yes' in column J of the "2013 Expenses" tab.  All "Yes"'s in column J should not be placed into the corresponding tabs.  Please let me know your thoughts or if an earlier version of the spreadsheet was loaded.  Thank you.
I was looking at that item next.  The bulk of the last update was the final tab.
I've been looking at this and realised the wrong version was uploaded.
Here is the correct one. It concentrated on the Non-FSA Miles tab.
The J column still contains yes rows. Still looking at this to remove those from the macro. In the short term an auto filter will remove them from the view.
TEST-2013-Medical-Expenses-TEST.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Rartemass
Rartemass
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Rartemass, thank you.  I will take a look and will advise.
Rartemass, this is great!  Thank you.  This will save me hours of work.  I really appreciate your help!
No worries, glad it works.