Solved

Help with Updating a Current Macro

Posted on 2014-01-27
14
136 Views
Last Modified: 2014-03-03
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
0
Comment
Question by:James0903
  • 8
  • 6
14 Comments
 
LVL 18

Expert Comment

by:Rartemass
ID: 39813680
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

0
 

Author Comment

by:James0903
ID: 39815581
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
0
 
LVL 18

Expert Comment

by:Rartemass
ID: 39816935
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:
Example of totals and formula
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.
0
 

Author Comment

by:James0903
ID: 39817720
Rartemass, yes, total on top is good with me.  Thank you.
0
 
LVL 18

Expert Comment

by:Rartemass
ID: 39827000
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.
0
 

Author Comment

by:James0903
ID: 39833184
Sounds good, thank you.
0
 
LVL 18

Expert Comment

by:Rartemass
ID: 39834696
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.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:James0903
ID: 39848317
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.
0
 
LVL 18

Expert Comment

by:Rartemass
ID: 39848962
I was looking at that item next.  The bulk of the last update was the final tab.
0
 
LVL 18

Expert Comment

by:Rartemass
ID: 39883942
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
0
 
LVL 18

Accepted Solution

by:
Rartemass earned 500 total points
ID: 39884070
I've made a change to the code again to make things work easier in my logic.
This removes the Yes in column J from the data. How is it now?
TEST-2013-Medical-Expenses-TEST2.xlsm
0
 

Author Comment

by:James0903
ID: 39896435
Rartemass, thank you.  I will take a look and will advise.
0
 

Author Closing Comment

by:James0903
ID: 39900492
Rartemass, this is great!  Thank you.  This will save me hours of work.  I really appreciate your help!
0
 
LVL 18

Expert Comment

by:Rartemass
ID: 39900566
No worries, glad it works.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now