Hi, thanks in advance for the help, i used to be a programmer but have never used VBA and was hoping to bounce a few idea's.
I have a large worksheet and i'm trying to use VBA to automate some comparing of message data i have in Excel. I've been carrying out the checks manually up unit now and its pretty boring.
The first 10 rows of the worksheet is basically message header information for the 10 types of messages (data) i'm analyzing (this is variable, sometimes i have 20 messages).
The following 5,000 lines is the actual data. I'm fortunate that the first column for each row can be used to see if its a header or data. If its a timestamp, its data.
I've decided to create a Message 2D Array and a Data 2D Array to manipulate the data. I'm working is small steps and first task was to build the two arrays. Here is the code i'm using, i should mention the messages have different numbers of attributes. Below is the code i'm using to find the max number of columns used by all the header rows. I then plan to create a 2D Array called messages. Does the code below look ok or is there an easier way?
'Get number of columns needed for Messages[]'
Do Until ActiveCell.Value <> "Header"
localMaxMessageAttributes = Worksheets("Data").Cells(ActiveCell.Row, Columns.Count).End(xlToLeft).Column
If localMaxMessageAttributes > maxMessageAttributes Then
maxMessageAttributes = localMaxMessageAttributes
End If
ActiveCell.Offset(1, 0).Select
Loop
I have a large worksheet and i'm trying to use VBA to automate some comparing of message data i have in Excel. I've been carrying out the checks manually up unit now and its pretty boring.
The first 10 rows of the worksheet is basically message header information for the 10 types of messages (data) i'm analyzing (this is variable, sometimes i have 20 messages).
The following 5,000 lines is the actual data. I'm fortunate that the first column for each row can be used to see if its a header or data. If its a timestamp, its data.
I've decided to create a Message 2D Array and a Data 2D Array to manipulate the data. I'm working is small steps and first task was to build the two arrays. Here is the code i'm using, i should mention the messages have different numbers of attributes. Below is the code i'm using to find the max number of columns used by all the header rows. I then plan to create a 2D Array called messages. Does the code below look ok or is there an easier way?
'Get number of columns needed for Messages[]'
Do Until ActiveCell.Value <> "Header"
localMaxMessageAttributes = Worksheets("Data").Cells(ActiveCell.Row, Columns.Count).End(xlToLeft).Column
If localMaxMessageAttributes > maxMessageAttributes Then
maxMessageAttributes = localMaxMessageAttributes
End If
ActiveCell.Offset(1, 0).Select
Loop