Pocitam ze delas v Excelu pres VBA ze? Zkus tohle
Dim m_rSetRange As Range
Dim m_rColumn As Range
Dim m_rMostColumn As Range
Dim m_rLastCell As Range
Dim m_lCountRecord As Long
Dim m_lMostRecord As Long
Set m_rSetRange = Range("L1:DC1")
m_lCountRecord = 0: m_lMostRecord = 0
For Each m_rColumn In m_rSetRange
m_lCountRecord = WorksheetFunction.CountA(Columns(m_rColumn.Column))
If m_lCountRecord > m_lMostRecord Then
Set m_rMostColumn = m_rColumn
m_lMostRecord = m_lCountRecord
End If
Next m_rColumn
Set m_rLastCell = Cells(Rows.Count, m_rMostColumn.Column).End(xlUp)
m_rLastCell.Select
MsgBox "Nejvic hodnot obsahuje sloupec - " & Mid(m_rMostColumn.Address, 2, InStr(2, m_rMostColumn.Address, "$") - 2) & vbCrLf & _
"Posledni bunka v tomto sloupci - " & m_rLastCell.Address
Set m_rSetRange = Nothing: Set m_rColumn = Nothing
Set m_rMostColumn = Nothing: Set m_rLastCell = Nothing
|