Excel 2010/2013
Excel 2007
Excel 2003
Tips & Tricks
Excel Forum
Course Index CIG Excel Book
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 

Forums     

Microsoft Excel Forum
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

 
This forum is for the discussion of Microsoft Excel.

Click Here To Subscribe to this forum and receive an email update whenever new posts are added, just scroll down to the bottom of this page and enter your email address in the comment form.

Permanent Link
Keywords: microsoft excel forum
Post New Topic

Read Dynamically change VB Macro to Project name by Perry S @ 7/9/2019
Good Morning Richard
I need some help if you would please

I have an Excel workbook that has a very detailed macro to make it work. And it does work well, I use the lessons from your Access classes to help me through it.
What the code is doing is it is coping and pasting the data from the one excel workbook into another.
The issue that I m having is the code has references to the workbook file name.
So, if I change the workbook file name the macro, for obvious reasons ceases to work.
How can I call the Project name or the file name into the code so that when I change the file name it dynamically changes the code?

Basically, any lines where the code says ("DDLTemplate.xlsm") the word Template be changing to the first initial and the last name of the driver.
Example ("DDLPShusta.xlsm")

Below is a short summary of the code

'Copy & Past Pay Period End
    Windows("DDLTemplate.xlsm").Activate
    Range("D4:K4").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("PayrollDetail.xlsm").Activate
    Range("C2:F2").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
    Windows("DDLTemplate.xlsm").Activate

Thank you
Perry Shusta




Show Just This Thread        Post Reply
Read Subtract Days by Daisy B @ 12/27/2018
Is there a way to have a spread sheet subtract days... for example.  I enter a date and I want it to count the data for 180 days then on the 181 day, it should stop counting.


Reply from Alex Hedley:

Do you have an example?
You enter a date in a column. You want the next column to calculate 180 prior to that?
Show Just This Thread        Post Reply
Read Excel and Access data transfer by John M @ 10/24/2018
Yes I have looked at expert 20 lesson. The reason for needing it in Excel is that our clients have a specific Excel form that they want used for invoicing. Some of the Excel spreadsheet have coding that they want in the invoice. So making a report is kind of out of the question. We have others clients that want Excel spreadsheets used but no background coding. These I have done by exporting the info from access into Excel. But I am unable to go this way with certain other clients. Hope this clarifies the situation better.


Reply from Alex Hedley:

It'll be complex but it is possible.
You can use VBA to dim up an Excel Object, open a give file and put data into given cells you need.
Show Just This Thread        Post Reply
Read Excel and Access data transfer by John M @ 10/4/2018
Hello, I am wanting to find out if this is possible or not, before I spend a lot of time looking. I have an Access DB and was wondering if you can transfer data out of Access into a pre-made Excel spreadsheet? I know and am able to transfer data into excel but not into a specific form.
Thanks in advance.


Reply from Alex Hedley:

Have you seen the outline for Expert 20?
Why do you need it in Excel?
Could you not make a Report in Access instead?
Show Just This Thread        Post Reply
Read Macro by ron b @ 4/28/2018
Do you have a lesson on creating Macro in Excel on this site? If you do can you post/email me the link - Tnx


Reply from Alex Hedley:

I don't think the Excel Courses got to Advanced to cover Macros.
Is there anything in particular you were wanting to automate?
Show Just This Thread        Post Reply
Read Email Data Collection by Sandra M @ 1/26/2018
Since Access stopped having email data collection, I tried using Google forms to collect our school's students schedule. The forms work very well to ask and collect the data, but I am having a hard time importing the data into my Access database tables. Though Google forms provides a spreadsheet with the data, I can't match the spreadsheet's rows and columns with my table's fields...help!


Reply from Alex Hedley:

You could import the data into a temp table then run a query to insert that data into your pre-existing table.
Show Just This Thread        Post Reply
Read Move Row by Toine v @ 11/29/2017
A have a schedule for my employs and when this work is done a put a value in een cel saying it is done. Then a want to move the whole row to a second sheet. All the others rows under this one will move up one row. Can this be done?


Reply from Alex Hedley:

How about trying this with the Macro Recorder, then you can look at what code is produced and amend accordingly.
Show Just This Thread        Post Reply
Read Move Row by Toine v @ 11/16/2017
How can i make a macro that moves a row if a cel hase a sertain value i put in it.


Reply from Alex Hedley:

So you type in a value in a give cell, is this cell always in the same column?
You then want that row to move?
How many rows do you wish to move it?
Show Just This Thread        Post Reply
Read Go to Last First sheet by MUBEEZI M @ 7/12/2017
Hi Alex,

I am still new to Excel 2016. There is something handy that i dont see any more. At the bottom left corner of an opened Excel workbook, there used to be small buttons to take you to the FIRST, previous, next or LAST sheet if your workbook had very many sheets. Was this feature removed? I only see previous and next but not FIRST and LAST. Or it is now somewhere else?

Please let me know

MICAH


Reply from Alex Hedley:

Have you seen https://excel.uservoice.com?
Microsoft now has one for each application where you can suggest features etc.
I found the following, you may wish to vote on this.
https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/10675620-go-to-first-last-tabs
Show Just This Thread        Post Reply
Read Purchase Question by ADAM S @ 5/2/2017
Yes, i used the same email address. I have looked in the Theater, logged out & back in. However I am still not seeing anything.


Reply from Alex Hedley:

I've passed this onto Rich, he'll be in touch shortly.
Did you get an email confirmation with an Order #?
Show Just This Thread        Post Reply
Read Purchase Question by ADAM S @ 5/2/2017
I purchased the Beginner Level 2 courses this morning at 10:45 am.  The order confirmation stated that my courses would be availible in 20 mins, however it's been and hour and 15 mins and they haven't posted yet.  Can someone please advise?

Thanks,
Adam


Reply from Alex Hedley:

It should be available in the online theater.
Did you use a different email address to buy it?
Try logging out and logging back in.
Show Just This Thread        Post Reply
Read Excel Combobox by Eddy @ 1/1/2017
Hi,
Hope you all have a healthy 2017!

Question:
Is it possible to add items to a dynamic named range with a combobox?

I know its easy in Access but at work we are not allowed to use Access.

If so please tell me in wich lesson(s) it is covered, also the use of userforms and starting up with the main form without showing Excel at all.
That would be great if possible.

Thanks
Eddy



Reply from Alex Hedley:

MS Article: How to create a dynamic defined range in an Excel worksheet
Show Just This Thread        Post Reply
Read Macro by Richard L @ 11/28/2016
Thank you, There are a lot of cool templates and if Rick wants to do a seminar on how to make cool spreadsheets, I'm intereste.
Show Just This Thread        Post Reply
Read Macro by Richard L @ 11/26/2016
It is a template called the "To Do List" on 2016 Excel.  But I can't seem to find out what is being done.  all I know is if you double click on that cell a check mark appears and all the cells in that row are formatted with a strikethrough format.


Reply from Alex Hedley:

I'll take a look into that template.
Show Just This Thread        Post Reply
Read Macro by Richard L @ 11/23/2016
At work we have an Excel 2016 and one of the templates is a to Do List.  There is a field that if you double-click on it a check mark appears and the text in the row it's in has a strikethrough.  What is this feature called and how and where do I learn to do that?  
Also the background is cool where it looks like a sheet of notebook paper.  How do you do that?


Reply from Alex Hedley:

Is this an Office template, what's it called, is there a link on the marketplace?
If you have the developer tab on can you look into any code it uses?
Show Just This Thread        Post Reply
Read Range Method limit by Gary @ 11/18/2016
Alex,
I actually found a work around so I thought Id post what was going on incase anyone else runs into this problem.

I have a fairly large spreadsheet that has a bunch of validation dropdowns. Now whenever a new sheet is needed I use a macro to create the new sheet and apply all the validations.

Original Code shortened

    With Range("B13:B20,B22:B29,B31:B42,B44:").Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="=Keys!$C$2:$C$31"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True  
    End With

As my spreadsheet grew this worked fine until I figured out that the range method has a 255 character limit. Now it took me a bit to figure this out, but to get around the 255 character limit you have to use a union to join your string into a variable then use the properties of the variable to apply the validations.

New Code Shortened
Set R1 = Range("E13:AJ20,E22:AJ29,")
Set R2 = Range("E160:AJ171,E176:AJ183")

Set RngAll = Application.Union(R1, R2)
  
    'Key Range
    With RngAll.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="=Keys!$A$2:$A$20"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True    
    End With





Reply from Alex Hedley:

Thanks for sharing.
Show Just This Thread        Post Reply
Read Range Method limit by Gary @ 11/15/2016
I am trying to use the range method to select multiple areas of a large worksheet but gives me an error.

I figured out that the string is too large or its a 255 character limit. Example Range(A1:AJ55,A60:AJ100, ETC.

Any ideas how to work around this?



Reply from Alex Hedley:

What is the end goal, if we know what you are trying to achieve we should be able to come up with another solution.
Show Just This Thread        Post Reply
Read Excel VBA by Robert Wathen @ 10/10/2016
Richard,

I have been checking on and off to see if you have had time to post a guide for Excel VBA. I learned A LOT from your Access tutorial and feel that I would benefit from your style if you created a module for xl VBA.


Reply from Alex Hedley:

I think he's focused on the Access updates currently.
Is there anything in particular you're looking for, I used to automate a lot of things in Excel many moons ago, should be able to dig out some of the code if you have a particular use case, and add them to the Tips section.
Show Just This Thread        Post Reply
Read Excel LOOKUP function example by Ron @ 7/24/2016
in the Excel 2010 Expert 4 lesson, they asked if anyone can think of a reason to use THE LOOKUP function, so I thought of a reason: if the lookup values and the return values are in different places. I posted an example here:
http://ph3000.blogspot.ca/2016/07/excel-lookup-example.html
Show Just This Thread        Post Reply
Read Help with formula by Bruce @ 5/27/2016
You could probably also use the AND function to accomplish the same result. The CHOOSE function could also come in handy.
Show Just This Thread        Post Reply

Show Older Posts         Collapse All Topics

 

Post Your Comments or Subscribe
    If you would like to be notified of new posts on this forum,
    just enter your email address below. It will be kept private.
 
If you just want to subscribe to get email updates when this forum is updated, then enter your name and email address and check the Notify Me box below. If you would optionally like to add your comments below to be posted, they are welcome.
 
  Your Name:  Required
  Your Email:  NOT Public
  Subject:
  Comments:

 

Sorry about this step. It's just to keep the spam bots away:
  Verify: What is 3+3:
  
  Notify me when the this forum is updated
  Remember Me for my next comments
  
 
 
Please do not use this form for Customer Service inquiries! If you have questions about your account, shipping info, courses you've ordered, need passwords, etc. please use the Customer Service Center instead.

I value your comments. They will be displayed on this page (above). Your name will be displayed, but your email address will not be.
As always, I promise to never give away your personal information to anyone else, ever.

NOTE: If you don't leave your name and email address, DON'T expect a reply. I can't promise a personal reply to everyone who posts here. I TRY my best, but I cannot guarantee it. If you don't leave your real name and email address, I won't even bother. I usually just hit DELETE. -Richard

 

 

You may want to read these articles from the 599CD News:

5/4/2014Microsoft Access Expert 20
3/5/2013Excel Tip: Price Markups
2/3/2013Signed Copies of my Excel Book
9/27/2012Excel Expert 10 Handbook Ready
9/18/2012Two New Excel Tips: Date/Time Differences
6/20/2012Excel Tip: Sum Cells Between Two Values
6/16/2012New Excel Tip: Paste Link
3/26/2012Excel Tip: 2D Matrix Lookups
11/18/2011Dashboards in Excel
10/6/2011Excel Expert 11 On Hold
 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP