By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

Using InputBox to change file links

P: 3
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.
Dec 20 '07 #1
Share this Question
Share on Google+
4 Replies


debasisdas
Expert 5K+
P: 8,127
Which cells are you editing? Is it in Excel or any other grid control?
Dec 20 '07 #2

P: 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:\SHARED\General_Services_Shared\DESIGN & CONSTRUCTION\Capital Projects Admin\REPORTS\Latest Reports\[Latest report 1200006013.xls]Full Report'!$H$19="r",'J:\SHARED\General_Services_Shar ed\DESIGN & CONSTRUCTION\Capital Projects Admin\REPORTS\Latest Reports\[Latest report 1200006013.xls]Full Report'!$H$20="r"),"R",IF(OR('J:\SHARED\General_Se rvices_Shared\DESIGN & CONSTRUCTION\Capital Projects Admin\REPORTS\Latest Reports\[Latest report 1200006013.xls]Full Report'!$H$19="a",'J:\SHARED\General_Services_Shar ed\DESIGN & CONSTRUCTION\Capital Projects Admin\REPORTS\Latest Reports\[Latest report 1200006013.xls]Full Report'!$H$20="a"),"A","G"))
Dec 21 '07 #3

Expert 5K+
P: 8,434
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.
Dec 27 '07 #4

P: 3
Thanks Killer42. That would be brilliant.
Jan 2 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.