+ Reply to Thread
Results 1 to 5 of 5

Macro to open workbook, change cell value and save

  1. #1
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Macro to open workbook, change cell value and save

    Hi.
    i'm looking for a code to do the following:

    First i'll have a workbook called ACTIVATE with only one sheet (let's call it MENU)
    In this sheet MENU on cell C5 i will write a number or anything
    Then i need a macro (so i can execute it from this workbook ACTIVATION) that will do the following:
    1. First, open a specific workbook called Product.xlsm which is in the same folder as the ACTIVATE.xlsm workbook;
    2. Second go to this workbook sheet called FIRST (sheet) and unprotect this sheet with the password "1234"
    3. Third, after unprotect the FIRST sheet, the macro should copy and past the value of the cell C5 from workbook ACTIVATE.xlsm into the cell E75 of FIRST sheet from Product.xlsm workbook.
    4. After this, this macro should protect the sheet FIRST with the same password again "1234", save and close the workbook Product.xlsm.

    Is this possible?
    I think it is... i just dont know how to put it in code.

    Can someone help please?

    Thank you.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Macro to open workbook, change cell value and save

    Not tested, but it should work :

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro to open workbook, change cell value and save

    @GC Excel

    Thank you for the reply. This code works really well except for one thing:
    In the workbook Product.xlsm where i want to past the content from cell C5 from the other wb, i want it to past only the values and not the cell itself.
    This code is copying the cell color and font color too and i need it to stay exactly in the same color as is set in Product.xlsm (so it stay hidden in the background - i put the font in the same color as the cell background in Product.xlsm).
    And as the code is itself right now it copies and pastes but takes out the format i have in the other workbook.
    I attatched a picture so you can see what is happening.

    Thank you for the help you already gave.
    Attached Images Attached Images

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Macro to open workbook, change cell value and save

    Change this line :
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro to open workbook, change cell value and save

    Now its absolutly PERFECT!

    Many thanks

    Regards

+ 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 save workbook as html then open it in a browser.
    By brent_milne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2012, 03:53 PM
  2. Macro to open txt file into a new workbook and save it
    By GHIREM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2012, 04:18 PM
  3. How to open,save and close another workbook from the current workbook using macro?
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2012, 10:42 AM
  4. Always open workbook Macro to save as date and start a new day
    By JazzyBear in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2012, 08:08 AM
  5. Macro to open workbook, run macro, save, and close.
    By rclark430 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2008, 08:07 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