Oh DearJust when I thought it was sorted, I come across a month that doesn't have any data to copy and so have found out the lngcount to see if data does exist is not working. Any idea?
Code:' **************** Hong Kong to Hamburg *********************************** 'reset lngCount lngCount = 0 With Application.WorksheetFunction 'count whether any shipment exist in May from Hong Kong to Hamburg lngCount = .CountIf(wksRawData.Columns(11), ">=" & May) _ - .CountIf(wksRawData.Columns(11), ">" & Jun) lngCount = lngCount * .CountIf(wksRawData.Columns(14), "=" & HK) lngCount = lngCount * .CountIf(wksRawData.Columns(15), "=" & HAM) End With




Just when I thought it was sorted, I come across a month that doesn't have any data to copy and so have found out the lngcount to see if data does exist is not working. Any idea?
Reply With Quote

Bookmarks