Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Select workbook with specific name

$
0
0

I have a weird situation where, I have to download one workbook everyday. The name of the workbook always starts with CMVOLT.

Whole file name is CMVOLT_22112019.

Now 22112019 represents date and obviously it will change daily.

Now I have macro to open this workbook as follows:

Sub openwb()

Dim sPath As String, sFile As String
Dim wb As Workbook

sPath = "C:\Users\Windows\Downloads\"
sFile = sPath & "CMVOLT_22112019.CSV"

Set wb = Workbooks.Open(sFile)

End Sub

So currently I need to change workbook name daily, so is there any way to select sheet with VBA starting with CMVOLT?

As I will have only one sheet at a time there which is starting with CMVOLT.

Any help will be appreciated.


Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>