+ Reply to Thread
Results 1 to 8 of 8

Loop macro displaying only certain cells and keeping their format

  1. #1
    Registered User
    Join Date
    03-31-2014
    Location
    London, England
    MS-Off Ver
    Excel Mac 2011
    Posts
    6

    Loop macro displaying only certain cells and keeping their format

    Hello all!

    This is my first thread so I hope I'll be clear enough.

    I attached a template so as to visualise my work.

    I would like to create a loop doing the following work:

    If INPUT!A2="IVR" then display Input!B2 in Audio!A2 with the same format.
    If not, then check Input!A3 and so on.

    At first I thought I could just put in Audio!A2 a simple If function like IF(Input!A2="IVR",Input!B2,""), but if I do so I have two major problems in my Audio sheet:

    1) The format (colours) is lost. (colours are crucial for what I want to do because they symbolise languages for a translation company)
    2) I have a lot of blank cells that I don't want. I would like to have only the IVR cells displayed in my "Audio" sheet.

    Thank you very much in advance for your help!

    Antoine
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Loop macro displaying only certain cells and keeping their format

    try this macro:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    03-31-2014
    Location
    London, England
    MS-Off Ver
    Excel Mac 2011
    Posts
    6

    Re: Loop macro displaying only certain cells and keeping their format

    Thank you for your answer Pierre! It works perfectly!
    Just one more thing, how would I do if I want to display these content in the column B of the Audio sheet and not in column A?

    Thanks again!

  4. #4
    Registered User
    Join Date
    03-31-2014
    Location
    London, England
    MS-Off Ver
    Excel Mac 2011
    Posts
    6

    Re: Loop macro displaying only certain cells and keeping their format

    In fact, I would like to also do the exact same thing and copy any IVR reference in column C of the "Input" sheet to column B of the "Audio" sheet.

    If I redo the code you gave me and change Cell.Offset(0,1).copy by Cell.Offset(0,2).Copy it copies the content as I want but put it under the column A as well...

    Would you or anyone have a clue?

    I posted a new file for you to see.

    Thanks,

    Antoine
    Attached Files Attached Files

  5. #5
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Loop macro displaying only certain cells and keeping their format

    here is the modified macro.
    I put, in comment, another way of doing it. If you uncomment those lines of codes, do not forget to comment the other ones.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-31-2014
    Location
    London, England
    MS-Off Ver
    Excel Mac 2011
    Posts
    6

    Re: Loop macro displaying only certain cells and keeping their format

    Thank you so much Pierre, I used the second suggestion of macro and it is working brilliantly!
    My last question would be: would there be a way to make it autmatic (not to have to clear content and apply the macro in sheet 3 each and every time sheet 1 is modified)?

    All the best,

    Antoine

  7. #7
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Loop macro displaying only certain cells and keeping their format

    OK, here is what can be done.
    The audio sheet can be delete automatically. But is it really what you want to do? I think you might want to delete the Audio sheet by triggering a macro that would do it automatically.

    Data transfer from Input to Audio sheet can be triggered automatically but you'll probably want to define some rules as in : the 3 rows in Input sheet must be filled before a transfer can be done. But what do you want to do if you only modify the text in column B or any other cells in this sheet. The macro will be programmed so that each time a cell is modified and that the 3 columns are filled, the transfer will occur. You might get duplicates though.
    I'm not sure how you want to handle all this.
    It's your call.

  8. #8
    Registered User
    Join Date
    03-31-2014
    Location
    London, England
    MS-Off Ver
    Excel Mac 2011
    Posts
    6

    Re: Loop macro displaying only certain cells and keeping their format

    Yes I think you are right, it might be too risky for the system. And anyway it is not time consuming to click on the macro button, and it enables a certain QA as well.

    Thanks again for everything!

    All the best,

    Antoine

+ 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. Combining cells, keeping date format.
    By emccalment in forum Excel General
    Replies: 2
    Last Post: 02-26-2016, 11:12 AM
  2. Keeping cells format after filtering
    By ElmerS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2010, 12:25 PM
  3. [SOLVED] Displaying results of loop in cells
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2005, 05:06 PM

Tags for this Thread

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