+ Reply to Thread
Results 1 to 6 of 6

Relative Reference

  1. #1
    Registered User
    Join Date
    06-15-2010
    Location
    Bayonne, NJ
    MS-Off Ver
    Excel 2007
    Posts
    4

    Relative Reference

    I am trying to record a macro. I don't know anything about VBA and I am just recording my actions. I am trying to take a daily report from another program and format it into a usable Excel spreadsheet. There are some columns and many rows to delete. I take the same steps everyday and would like to automate the process. First, I remove the blank filler columns (which the other program uses to space the data), autofit the columns with data and format the text. Then, I need to eliminate the empty rows seperating each customer. This amounts to hundreds of rows. Manually, I use ctrl-end, delete the last 3 rows (unneeded data), use shift-ctrl-home to highlight all of the data, put in filters, show only blank rows, and delete those rows. However, recording the macro this way causes problems for any report longer than the original. When I record it using relative references, I get errors. If recording without relative references, when you hit ctrl-end does it record as ctrl-end (and therefore should always go to the last cell regardless of the size of the report) or does it record as the actual cell it ends up on (which would explain why my longer reports format the upper half of the report and not the bottom). Any thoughts? Any more info I need to give? Thanks!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Relative Reference Issue?

    Hello JDMCMAMC815,

    Welcome to the Forum!

    Why not post the workbook to better illustrate the problem? It will be faster and easier to answer your questions with everyone being on the same page. If you have any personal or confidential information, please either change it or remove it before posting the workbook.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-15-2010
    Location
    Bayonne, NJ
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Relative Reference Issue?

    Okay, I have replaced all of the confidential information. Before I attach it, how should I let you know the exact steps I take each day? I have a macro that works for this day, but not for reports with more transactions. Can I attach the macro as well? Thanks.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Relative Reference Issue?

    Hello JDMCMAMC815,

    Posting Information is like dressing for cold weather. Better to have to much than no enough.

  5. #5
    Registered User
    Join Date
    06-15-2010
    Location
    Bayonne, NJ
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Relative Reference Issue?

    Attached is the spreadsheet exactly as the other program exports it (with confidential information altered). It is a list of all ATM transactions performed by our customers in one day. Here is the macro that works for this file, but not different size reports:
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 06-17-2010 at 02:32 PM. Reason: Added Code Tags

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Relative Reference Issue?

    Hello JDMCMAMC815,

    To make your posts easier to read, copy, and edit please wrap your code. I did it for you this time. Here is how you can do it next time.

    How to wrap your Code using the # icon
    1. Select all your code using the mouse.
    2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.

    To manually wrap your code, use these Bulletin Board Code Tags
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] at the end of the last line.


    To learn more about BB codes used in this forum, just click on the link below...

    Bulletin Board Codes Tags

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1