+ Reply to Thread
Results 1 to 6 of 6

Macro to Move Cells Based on Value of Another Cell?

  1. #1
    Registered User
    Join Date
    09-22-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    3

    Macro to Move Cells Based on Value of Another Cell?

    See below screenshot, I need some help creating a formula for this. I have a list of services that I have to export to excel daily, and then manually edit it and then upload it to another program. I have a macro that does most of the formatting automatically, but there are two hiccups that I can't seem to figure out a solution to.

    The first is the data that starts on line 47. This is the footer data that is included when you run this particular report, and it is always at the bottom of the first page, but the position varies based upon the number of entries above it, so while right now it is on line 47, it may be on line 46 on another day. I have been unable to figure out a way to tell Excel "see if a cell in column B has "Generated by" in it and then delete that line along with the 15 lines", in this particular example I would want to delete lines 47-62.

    The second and similar problem is, due to a quirk of our software, sometimes the data on the second page will be offset. You will see that on the first page column H has "I" for each entry, but on the second page everything has shifted to the right one cell, and just to make things extra fun and difficult the bottom part of the header for row G has shifted over, but not the top part of the column header. For this scenario I have been unable to figure out how to tell Excel "Look for any data in row I that has a value of the letter I, if it does shift everything over to the left, starting with column G."

    I know that both of these need some sort of if statement, I am somewhat familiar with programming but Excel and VBA is something I have never messed with and it seems to be absolutely evading me. Is what I want to do possible?

    Attachment 696405
    Attached Files Attached Files
    Last edited by nikkisayswhat; 09-22-2020 at 01:55 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Macro to Move Cells Based on Value of Another Cell?

    It's hard to work with a picture. It would be easier to help and test possible solutions if you could attach a copy of your file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). See the yellow banner at the top of this page for instructions to attach a file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    09-22-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    3

    Re: Macro to Move Cells Based on Value of Another Cell?

    Sorry about that, I attached the workbook!

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Macro to Move Cells Based on Value of Another Cell?

    Try:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-22-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    3

    Re: Macro to Move Cells Based on Value of Another Cell?

    Quote Originally Posted by Mumps1 View Post
    Try:
    Please Login or Register  to view this content.
    That worked perfectly, thank you so much! Starting next week I am gone for a month on Medical leave and I have been trying hard to get this to work so I can make things easier on the person who fills in for me, and this is EXACTLY what I needed!

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Macro to Move Cells Based on Value of Another Cell?

    You are very welcome and get well soon.

+ 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. Macro to move cells to the right based on criteria
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-07-2020, 09:23 PM
  2. [SOLVED] Move Data in Cells based on another cell contents
    By TimPin in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-20-2019, 11:29 AM
  3. Move cells based on cell length *shift cells right) - code required
    By pauldaddyadams in forum Excel Programming / VBA / Macros
    Replies: 49
    Last Post: 11-21-2014, 08:56 AM
  4. Move cells based on duplicate value of other cell
    By chowmouse21 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2013, 06:58 AM
  5. Replies: 19
    Last Post: 02-08-2013, 05:59 PM
  6. Move data between cells based on value of another cell
    By brian0612 in forum Excel General
    Replies: 3
    Last Post: 03-30-2009, 10:59 AM
  7. Macro to move cell down a row based on criteria
    By neilcarden in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2009, 05:20 AM

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