+ Reply to Thread
Results 1 to 11 of 11

Macro to align formating

  1. #1
    Registered User
    Join Date
    07-26-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    11

    Macro to align formating

    Can anyone help me record a macro or create a macro that will copy the row underneath and paste it above? I have an export of 3000+ rows and I would prefer to automate this task. When I record a macro it only modifies that same range when the recording took place. How do you tell a macro to do the same for other rows and columns?
    Attached Files Attached Files
    Last edited by taxx411; 02-03-2022 at 11:21 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,480

    Re: Excel VBA Macro that will copy the row underneath and paste it above

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you have not posted here often, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Macro to align formating

    I have looked at your file and have no idea what you want to happen. Please explain in detail using the file you have provided as an example. Show us some sample mocked up results.

    A sample file need only have 8-15 records, not 7000.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    07-26-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Macro to align formating

    Alan - Good point. I apologize for sending such a large file.

    There is data in the file that looks complete and data that is scattered.

    I want a macro that will automatically copy the address from underneath and bring it up as I've done with other rows. And also delete that row where the data was copied from.

    I can show you over zoom if possible

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Macro to align formating

    How will I know which are complete and which are not. Provide examples of both so we know what to do. You know your workbook. We don't. You need to be explicit in your explanations to us. Do not assume we understand your workbook just because you uploaded a sample. Explain it with examples and not generalities.

  6. #6
    Registered User
    Join Date
    07-26-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Macro to align formating

    Please read the instructions in the new sample file.

    A new file called VBA

    Yellow is the final product

    Red = raw data
    Attached Files Attached Files

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Macro to align formating

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-26-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Macro to align formating

    Thank you. I'm just getting started with VBA.

    Any idea where I need to place this code?

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Macro to align formating

    How to install your new code
    • Copy the Excel VBA code
    • Select the workbook in which you want to store the Excel VBA code
    • Press Alt+F11 to open the Visual Basic Editor
    • Choose Insert > Module
    • Edit > Paste the macro into the module that appeared
    • Close the VBEditor
    • Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


    To run the Excel VBA code:
    • Press Alt-F8 to open the macro list
    • Select a macro in the list
    • Click the Run button

  10. #10
    Registered User
    Join Date
    07-26-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Macro to align formating

    Thank you it worked but I need to clean up my spreadsheet. You're a life-saver.!

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Macro to align formating

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel macro to copy values from mutiple excel to single excel
    By pravkuma82 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-13-2017, 02:19 AM
  2. Excel Macro to copy Excel Invoice data to Excel Database - Works Perfect. But
    By asifmars in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 04:01 AM
  3. Requesting help in Excel Macro Tutorial/Basic Steps in creating a Macro in Excel
    By rhaiyan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2013, 09:21 PM
  4. Replies: 2
    Last Post: 11-26-2012, 08:33 AM
  5. Excel Macro (excel for mac 2010) - update multiple excel books on criteria
    By genichigo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2012, 07:23 AM
  6. Excel 2003 Macro --> Excel 2000 Macro
    By Tejas.T in forum Excel General
    Replies: 2
    Last Post: 10-21-2012, 07:57 AM
  7. Optimizing Excel macro to find/replace with the list of data contained in the macro
    By Iceyburnz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-17-2008, 08:41 PM

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