+ Reply to Thread
Results 1 to 2 of 2

Search and change! (not and destroy!)

  1. #1
    Registered User
    Join Date
    07-17-2006
    Posts
    54

    Search and change! (not and destroy!)

    Ok i got alot of cells in my files where there is "=VLOOKUP(...)" function! There's two files that the VLOOKUP function can search in. Let's say 1_2006.xls and 2_2006.xls! I need a macro that will search in all function for thoses files and change the names files to 1_2007.xls and 2_2007.xls! There is also some call of those files in some macro! So the "Macro" has to also change the name of files in the other macros! Would be could if there would be an Inputbox where the user could write the year he want the new files to be! Any idea? Thanks for the help!

    Maxime

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    As for the spreadsheet data you can use Edit\Replace or Ctl-H and input 1-2006.xls to be replaced by 1-2007.xls

    As for the code if you are referencing items that will change frequently it is best to set them to a constant at the top of your module. This way you only have to replace it where it is defined.


    Quote Originally Posted by mhax
    Ok i got alot of cells in my files where there is "=VLOOKUP(...)" function! There's two files that the VLOOKUP function can search in. Let's say 1_2006.xls and 2_2006.xls! I need a macro that will search in all function for thoses files and change the names files to 1_2007.xls and 2_2007.xls! There is also some call of those files in some macro! So the "Macro" has to also change the name of files in the other macros! Would be could if there would be an Inputbox where the user could write the year he want the new files to be! Any idea? Thanks for the help!

    Maxime
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

+ 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