+ Reply to Thread
Results 1 to 6 of 6

run vba on current workbook

  1. #1
    Registered User
    Join Date
    09-12-2007
    Posts
    7

    run vba on current workbook

    I searched this forum some time ago when i started this script, i wanted to run the vba on another workbook untill i was finished with the code. but now i am done and i don't remeber how to change it back to run on the current open workbook.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    What is your code supposed to be doing? There appear to be undeclared variables

    Thisworkbook refers to the workbook that contains the code.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-12-2007
    Posts
    7
    This scripts opens another workbook and retives the data from it in A:A, then looks up the current status of that data then log's it in B:B of that workbook.

    when i first started i didn't want to use the script in the same workbook of the data incase i messed something up. now that i am done I want one workbook for everything. but I have forget how to chage the script back.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I'm sorry but your code is not self explanatory. Is this what you want?

    A master workbook containing code.
    The code will open a workbook and copy data from Column A to the master workbook's Column B.
    Is the source workbook always the same?

  5. #5
    Registered User
    Join Date
    09-12-2007
    Posts
    7
    sorry to confuse, here is better detail

    Data(workbook) this has the data in A:A that is needed to be updated in B:B.
    Script (workbook) this runs the script that is above, it opens Data(workbook)
    looks at the data in A:A one cell at a time, and updates the data in B:B of the Data(workbook) one cell at a time.

    I changed this when i first started to run the script on a seperate workbook(data) so if i made any mistakes it would not change the information i needed to keep.

    but now the script is complete, but i don't remeber how to change it back to run the script from with in the data workbook. I found how to change it here in this forum some time ago. but have reformated since then and don't have that post saved anymore on my hdd.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not work on a copy of the workbook? I have removed what i think is unnecessary, but I don't know what this is: WriteValueToScreen

    Please Login or Register  to view this content.
    This looks like it will do what you want, although I don't see why you need to put the cleaned data into another Column.

    Please Login or Register  to view this content.

+ 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