Hi All,
I am having 2 modules in one macro, in the 1st module the file will open using filepath this filepath will be taken from sheet1 cell, i will take the path and open that file.
But when i use 2 module how to read the workbook name .
because the file will change some times. for module1 it will direct taken from the cell value , but how 2nd module will take
]
I am having 2 modules in one macro, in the 1st module the file will open using filepath this filepath will be taken from sheet1 cell, i will take the path and open that file.
But when i use 2 module how to read the workbook name .
because the file will change some times. for module1 it will direct taken from the cell value , but how 2nd module will take
VBA Code:
Set Price = Workbooks.Open(Filename:=(Macrohome.Range("D6").Value))
[/CODE[CODE=vba]
Dim Strpath as string
Dim StrFile as string
Strpath = Macrohome.Range("D6").Value
StrFile = Right(Strpath, Len(Strpath) - InStrRev(Strpath, "\"))
Set Price = Workbooks.StrFile