Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm new to VBA programming and have been working on a generic input sheet which will save details in different folders relevant to variables in a few cells (questions via a userform completes these cells). I've got most of the varibles to work when searching for the correct file but I can't seem to get the below to work. Is this because it's a variale itself and therefore not possible? sectionfolder = Workbooks("KPI Advisor stat sheet.xls").Worksheets("Stats").Range("C1") 'in this case Export sectiontotalname = Workbooks("KPI Advisor stat sheet.xls").Worksheets("Stats").Range("D1") ' IN this case Export Total advisor = Workbooks("KPI Advisor stat sheet.xls").Worksheets("Stats").Range("E1") ' In this case Export 1 sectiontotalworksheet = Workbooks("KPI Advisor stat sheet.xls").Worksheets("stats").Range("F1") ' In this case Total Export Application.ScreenUpdating = False ' This one works fine. Workbooks.Open Filename:="S:\Credit Management\Shared\KPI's\Section\" & sectionfolder & "\Current\" & sectiontotalname & ".xls" ' but I can't get this variable to follow the correct path. I've tried with and without the &'s and xls. monthopen = Workbooks(sectiontotalname).Worksheets(sectiontota lworksheet).Range("M1").Value Any help would be much appricated. Thanks carl |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum if 2 variables | Excel Discussion (Misc queries) | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Storing variables in a macro and using those variables to performcalculations. | Excel Programming | |||
Variables... Help! | Excel Programming | |||
Variables | Excel Programming |