Using InputBox to change file links

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fillip
    New Member
    • Dec 2007
    • 3

    Using InputBox to change file links

    I am trying to use the InputBox function to automatically edit a number of cells with a similar file link. The file path remains constant but the file name changes in each case, by a 10 digit project number. I figure the best way would have the user input the project number into an input box and the response used with the replace function to amend the link. I'm also a bit of a Visual Basic novice.
    Last edited by Killer42; Dec 20 '07, 11:36 PM.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Which cells are you editing? Is it in Excel or any other grid control?
    Last edited by Killer42; Dec 24 '07, 09:23 PM.

    Comment

    • fillip
      New Member
      • Dec 2007
      • 3

      #3
      It is in Excel. The formula is similar to the one below which relates to about 9 different groups of cells.

      =IF(OR('J:\SHAR ED\General_Serv ices_Shared\DES IGN & CONSTRUCTION\Ca pital Projects Admin\REPORTS\L atest Reports\[Latest report 1200006013.xls]Full Report'!$H$19=" r",'J:\SHARED\G eneral_Services _Shared\DESIGN & CONSTRUCTION\Ca pital Projects Admin\REPORTS\L atest Reports\[Latest report 1200006013.xls]Full Report'!$H$20=" r"),"R",IF(OR(' J:\SHARED\Gener al_Services_Sha red\DESIGN & CONSTRUCTION\Ca pital Projects Admin\REPORTS\L atest Reports\[Latest report 1200006013.xls]Full Report'!$H$19=" a",'J:\SHARED\G eneral_Services _Shared\DESIGN & CONSTRUCTION\Ca pital Projects Admin\REPORTS\L atest Reports\[Latest report 1200006013.xls]Full Report'!$H$20=" a"),"A","G") )
      Last edited by Killer42; Dec 23 '07, 04:13 AM.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Sorry to see you're not getting much of a response on this. I guess things get pretty quiet over Christmas.

        I think probably the simplest thing would be to write a function to do what you want, then just use that function in the formula. For instance the cell could just say something like: =MyFunction()

        The function, written in VBA, can prompt the user to enter the number, then open the appropriate worksheet, check the appropriate values, make decisions, and return the appropriate value.

        When I have time, I'll try to help you with the code for the function if you like.

        Comment

        • fillip
          New Member
          • Dec 2007
          • 3

          #5
          Thanks Killer42. That would be brilliant.

          Comment

          Working...