View Single Post
 
Old 11-08-2014, 02:11 PM
whatsup whatsup is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

... and that way it works with the closed source (you will have to adjust strPath):
Code:
Sub Get_DataOfClosedWB()
Dim lngCol As Long
Dim lngMonth As Long
Dim lngStart As Long
Dim strformula As String
 
Const strPath As String = "H:\Excel-Forum-temp-MSEnglish\"
Const strCellRef As String = "$F$6"
 
With ActiveSheet
    lngStart = .Cells(2, 1).Value
    lngMonth = Month(.Cells(2, 1).Value)
    
    Do While Month(lngStart + lngCol) = lngMonth
        'Insert formula
        .Cells(2, lngCol + 2).Formula = "='" & strPath & "[Source WKB.xlsx]" & Format(lngStart + lngCol, "DD.MM.YY") & "'!" & strCellRef
        lngCol = lngCol + 1
    Loop
End With
    
    
End Sub
Reply With Quote