ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Input box that ask for web address.. (https://www.excelbanter.com/excel-programming/339667-input-box-ask-web-address.html)

Ella[_2_]

Input box that ask for web address..
 
What if the file this time is from a web address
https://something.something.somethin.../filename.more
verbage.something.123456.xlsl

How do i go about asking the macro to run the input box. Or do i just
have to save it as an excel file first and just run the following
statemnt.?

If the file and its location were something like

"C:\MyFolder\Myfilenamestart123456.xls" then you could use:

Sub OpenFile()
Dim title as String, ans as String
Title = "Q:\Daily\Weekly and HBI reports"
ans = InputBox("Enter the 6 digit number")
if len(ans) < 6 or not isnumeric(ans) then
msgbox "Incorrect, try again"
exit sub
End if

Workbooks.Open Title & ans & ".xls"
End Sub


Tom Ogilvy

Input box that ask for web address..
 
It wouldn't be any different.

--
Regards,
Tom Ogilvy

"Ella" wrote in message
oups.com...
What if the file this time is from a web address

https://something.something.somethin.../filename.more
verbage.something.123456.xlsl

How do i go about asking the macro to run the input box. Or do i just
have to save it as an excel file first and just run the following
statemnt.?

If the file and its location were something like

"C:\MyFolder\Myfilenamestart123456.xls" then you could use:

Sub OpenFile()
Dim title as String, ans as String
Title = "Q:\Daily\Weekly and HBI reports"
ans = InputBox("Enter the 6 digit number")
if len(ans) < 6 or not isnumeric(ans) then
msgbox "Incorrect, try again"
exit sub
End if

Workbooks.Open Title & ans & ".xls"
End Sub





All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com