Solved

Help with Updating a Current Macro

Posted on 2014-01-27
14
137 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

863 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

23 Experts available now in Live!

Get 1:1 Help Now