[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help with Updating a Current Macro

Posted on 2014-01-27
14
Medium Priority
?
143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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
 

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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

649 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