+ Reply to Thread
Results 1 to 3 of 3

VBA code does not work when file is reopened

  1. #1
    Registered User
    Join Date
    07-01-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    47

    VBA code does not work when file is reopened

    I want to take a number and insert it towards the front of all the data points and have that automatically inserted at the end of that row. there will be a long string of data in that row and the number of data points will vary from person to person. Some will have a few and some will have several dozen entries. I was told that I needed a VBA code to make that work. I was given one on this forum and it works fine, that is just after I insert it and save it, but when I close the file and reopen it, the code is still there, but the spreadsheet does not perform that function. Why is that?

    There are two attachments ...rounding question2.xlms has the code and ...rounding question1.xlms does not. I tried to insert the code on this message board but I do not know how to properly do that, (it's not in compliance). But I have included both attachments. If you open attachment ....2 and paste to attachment ....1 it works, but when I close it and reopen it, it does not (and the code is still there).

    To get to the code section of what I am trying to do, open #2 and right click the player ID tab, then click on view code. Once you do that you'll see the code. Copy it and then open ..rounding question1.xlms open the player ID tab by right clicking then paste the code. Save the file as a macro-enable file type then you can insert numbers in column G and they will also automatically go to the end of that row - just like I want them to do!! But when I close that file and reopen it - it no longer works?
    Last edited by rwhite713; 07-22-2010 at 03:35 PM. Reason: was not in compliance - trying to comply

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: VBA code does not work when file is reopened

    Thia may happen because of your security settings. Please see this video and say me if it is.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    07-01-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: VBA code does not work when file is reopened

    It was the trust center settings - I had to change that. Thank you very much for your help!

+ 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