Quote Originally Posted by porucha vevrku View Post
I will answer the second bit first or at least try to.

In your image you have column A. We can ignore this as a date as it only contains the name of the equipment the data in the remaining columns is for and is used as a title for the chart. The way you have layed out the rest of it is correct.

But what will happen if any of the "dates" will not be a date ?
I don't quite understand what you mean. The whole process is to find a cell in a row that doesn't contain a date. This I have achieved thanks to your help. See below.

Then how do you change this "U", what value or letter or something else ?
Exactly. This is the hard bit I think. I have an idea but I am not sure how to apply it.

And why "c = c - 1" and not just "c" ?
The reason I have c = c - 1 is that when I detect the first cell without a date c has already been incremented so I need to go back to the previous cell, the last one with a date.


I am not sure what the following code is doing. Remember noob here.
I would see it this way:
(the letters of the columns are kept in the array variable and wait for the right moment)
Option Explicit

Sub Date_Cell()
    Dim c As Integer, cols As Integer, indx As Long, arr()
    indx = 0
    cols = Cells(1, Columns.Count).End(xlToLeft).Column
    For c = 2 To cols
        If IsDate(Cells(2, c).Value) Then
            indx = indx + 1
            ReDim Preserve arr(1 To indx)
            arr(indx) = Split(Columns(c - 1).Address(1, 0), ":", -1, 1)(0)
        End If
    Next
    MsgBox "Letters of columns with dates:" & vbCrLf & Join(arr, vbCrLf)
    'Erase arr '???
End Sub
My idea, if possible, would be to change the cell references below to row/column numbers then replace the U with a variable. Is that possible?

rng = Array("A8:U8", "A9:U9", "A11:U11", "A12:U12", "A13:U13", "A14:U14", "A15:U15", "A17:U17", "A23:U23", "A28:U28", _
                "A29:U29", "A30:U30", "A31:U31", "A32:U32", "A33:U33", "A34:U34", "A35:U35", "A36:U36", "A37:U37", "A39:U39", _
                "A40:U40", "A41:U41", "A44:U44", "A45:U45", "A46:U46", "A47:U47", "A48:U48", "A49:U49", "A57:U57", "A58:U58", _
                "A59:U59")