Trevor3007
Well-known Member
- Joined
- Jan 26, 2017
- Messages
- 675
- Office Version
- 365
- Platform
- Windows
hi.
On the worksheet named 'timesheet' I want to put a msgbox to state "input date In Cell A2" and a input box to appear & place the applicable in a2. Then move to the worksheet called 'Sheet1' . Again I need a msg box to say"Attach File" and move the cursor H2 and upon enter run the following code/macro (macro is called ThisWorkbook.GetFilePath):-
Sub GetFilePath()
Dim dialogBox As FileDialog
Set dialogBox = Application.FileDialog(msoFileDialogOpen)
'Set the display properties - these are optional
'All the settings must be applied before the .Show command
'Do not allow multiple files to be selected
dialogBox.AllowMultiSelect = False
'Set the title of of the DialogBox
dialogBox.Title = "Select a file"
'Set the initial path to :
dialogBox.InitialFileName = "C:\data"
'Show the dialog box and output full file path and file name
If dialogBox.Show = -1 Then
ActiveCell.Value = dialogBox.SelectedItems(1)
End If
End Sub
Hoping someone can help & solve.
KR
Trevor3007
On the worksheet named 'timesheet' I want to put a msgbox to state "input date In Cell A2" and a input box to appear & place the applicable in a2. Then move to the worksheet called 'Sheet1' . Again I need a msg box to say"Attach File" and move the cursor H2 and upon enter run the following code/macro (macro is called ThisWorkbook.GetFilePath):-
Sub GetFilePath()
Dim dialogBox As FileDialog
Set dialogBox = Application.FileDialog(msoFileDialogOpen)
'Set the display properties - these are optional
'All the settings must be applied before the .Show command
'Do not allow multiple files to be selected
dialogBox.AllowMultiSelect = False
'Set the title of of the DialogBox
dialogBox.Title = "Select a file"
'Set the initial path to :
dialogBox.InitialFileName = "C:\data"
'Show the dialog box and output full file path and file name
If dialogBox.Show = -1 Then
ActiveCell.Value = dialogBox.SelectedItems(1)
End If
End Sub
Hoping someone can help & solve.
KR
Trevor3007
Last edited: