+ Reply to Thread
Results 1 to 6 of 6

Macro to find Column and Format it

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Macro to find Column and Format it

    Hi,

    Can anyone please assist me in the macro code required to search a work sheet for a field which can be located any where in row 1 called ‘Billable’ and once found format the column it is in to ‘Text’

    Any assistance would be greatly appreciated

    Many thanks in advance

    Rob

    N.B. Excel version 2003
    Last edited by robertguy; 11-29-2010 at 11:58 AM. Reason: To Mark Solved
    Rob

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Macro to find Column and Format it

    Here's one
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to find Column and Format it

    robertguy,

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Adding the Macro
    1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Then run the FindBillable macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to find Column and Format it

    Dave,

    many thanks for your prompt reply it is very much appreciated.

    That said, as the code will be included into another macro I do not need the input box asking for the field name as in this case it will always be 'Billable’ - can you advise me how to amend your code so it will automatically search for the column headed Billable’ and format to text accordingly.

    Many thanks

    Rob

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Macro to find Column and Format it

    How about
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to find Column and Format it

    davesecel and Stanleydgromjr

    Many thanks - both your solutions were excellent

    Thanks again

    rob

+ 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