Thread: Form Fun...
View Single Post
  #5   Report Post  
tonyDeBrasco
 
Posts: n/a
Default


Thats true, the code I supplied only catered for one textbox, Im taking
baby steps. I figure if I can get it to pull data in from one sheet in
a particular work book it should be easy enough to get it do it for
others.

I copied your tidied up code and well it had unexpected results. I am
launching the form via a button on sheet 1 of the work book which will
contain the overall totals. After entering a complete path for a .xls
file it merely copied the button and placed it on a sheet called
"Overall Totals". So it is at least creating the destination sheet of
the data.

I looked over the code again and should the line

For Each sh In ThisWorkbook.Worksheets

not contain a reference to what was entered in the textbox, perhaps
something like

For Each sh In myVar.Worksheets

however I don't want it to take every sheet, only sheets named Totals,
how could I specify that, something like

For sh.Name == "Totals" in myVar.Worksheets

Also when I entered the line
For Each sh In myVar.Worksheets

it gave me the following error "compiler error: invalid qualifer" and
highlighted the myVar in the code? Is this because myVar is defined as
a string and not as a worksheet or something?

Thanks for your continuing help, solution is getting closer (I hope),
Tony


--
tonyDeBrascoPosted from http://www.pcreview.co.uk/ newsgroup access