Basically I’m creating a excel app that, when run, will prompt the user to point at the a specific excel file, and it will take the location in as a string, that works fine. What I am not sure how to do is choose a range in the active worksheet and take the value in each cell and combine them into 1 string.
This is my code so far:
Option Explicit
Sub locate_file()
Dim file As String
Dim sheet1_95 As String
Dim theRange As Range
'prompt user for location of other excel sheet'
file = Application.GetOpenFilename("Excel Files (*.xlsx), *.xlsx")
'test input of location'
Workbooks("testing input file.xlsx").Sheets("location").Activate
Range("A1") = file
'activate the workbook and sheet'
Workbooks("95%.xlsx").Sheets("DT").Activate
'Testing retrieving cells as string'
Set theRange = Range("A2:A4")
'how do i retrieve values in this range and combine them into 1 string?'
End Sub
1 Answer