Hi guys,
I have a masterworkbook that consolidates data from 50 different workbooks via vba. The thing is that in each of the 50 workbooks there are check boxes on three sheets. Is it possible to write a code in the existing masterWB that can ask for and turn on/off these checkboxes? My original code is:
Sub Knapp1_Klikk()
Dim fPATH As String, fNAME As String, NR As Long
Dim wbDATA As Workbook, wsMASTER As Worksheet
Set wsMASTER = ThisWorkbook.Sheets("databank_fvp") 'edit this to the name of the master sheet
NR = wsMASTER.Range("A" & Rows.Count).End(xlUp).Row + 1 'next empty row on the master sheet
fPATH = "\\sgm434\avdelinger2$\CA\RL\Stab RL\NRL Forretningsteam\FVP\12.06.2013\FT\" 'path to all files
fNAME = Dir(fPATH & "*fvp*.xls*") 'get the first filename from the folder
Do While Len(fNAME) > 0 'process one file at a time til no more filenames
Set wbDATA = Workbooks.Open(fPATH & fNAME) 'open the found file
With wbDATA.Sheets("databank").Range("2:74") 'copies pax & atm
wsMASTER.Range("A" & NR).Resize(73, 1).EntireRow.Value = .Value
End With
wbDATA.Close False 'close the found file
NR = wsMASTER.Range("A" & Rows.Count).End(xlUp).Row + 1 'next empty row on the master sheet
fNAME = Dir 'get the next filename
Loop
End Sub
Bookmarks