![]() |
traversing across columns in VBA
I have the following:
F | G| H | I | J |K .... to T Sum of Error 1 2 4 3 1 1 1 3 2 1 1 1 2 4 1 2 3 1 1 1 1 1 1 0 4 .. The numbers represent error codes. Up to now I have created a vba macro that creates an array for each learner with the number of errors they got. I now need to match the error codes against another table in another worksheet. How do I traverse from F to S ? ie what methods are available and the syntax please. Going down to get the error was easy as I created an index and did x + 1 and concatenate this to the column Letter but I am not sure how to traverse across. Regards in advance Peter |
traversing across columns in VBA
Column F is 6; column S is 19
For R = 1 To 20 For C = 6 To 19 'do something here with the value in column C T = T + Cells(R, C).Value Next C Next R In article , says... I have the following: F | G| H | I | J |K .... to T Sum of Error 1 2 4 3 1 1 1 3 2 1 1 1 2 4 1 2 3 1 1 1 1 1 1 0 4 . The numbers represent error codes. Up to now I have created a vba macro that creates an array for each learner with the number of errors they got. I now need to match the error codes against another table in another worksheet. How do I traverse from F to S ? ie what methods are available and the syntax please. Going down to get the error was easy as I created an index and did x + 1 and concatenate this to the column Letter but I am not sure how to traverse across. Regards in advance Peter |
traversing across columns in VBA
Tushar
You tried to help me but that wasnt what I meant traverse in english means to move across either up or down. I did the down part ex A1, A2, A3 A4 getting the contents of the cell as I went. I now want to go across the columns ex A1, B1, C1 and get the data in the cell. Regards Peter "Tushar Mehta" wrote in message ... I don't understand what it means to 'traverse from F to S' or what exactly you did with x+1 and concatenation. But if you have a number in the 'Sum of error' column and you want to translate that error into some other code based on a table, check out the VLOOKUP function. It's an XL function that can be used in VBA through Application.Worksheetfunction.VLookup() -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I have the following: F | G| H | I | J |K .... to T Sum of Error 1 2 4 3 1 1 1 3 2 1 1 1 2 4 1 2 3 1 1 1 1 1 1 0 4 . The numbers represent error codes. Up to now I have created a vba macro that creates an array for each learner with the number of errors they got. I now need to match the error codes against another table in another worksheet. How do I traverse from F to S ? ie what methods are available and the syntax please. Going down to get the error was easy as I created an index and did x + 1 and concatenate this to the column Letter but I am not sure how to traverse across. Regards in advance Peter |
traversing across columns in VBA
I found the answer myself with :
For intx = 0 To LearnerCount - 1 ' for each learner change row offset For Each Cell In Range("F10:S10") 'set range value = Cell.Offset(intx, 0).value ' get the value Next Next intx regards to forum "Peter Bailey" wrote in message ... Tushar You tried to help me but that wasnt what I meant traverse in english means to move across either up or down. I did the down part ex A1, A2, A3 A4 getting the contents of the cell as I went. I now want to go across the columns ex A1, B1, C1 and get the data in the cell. Regards Peter "Tushar Mehta" wrote in message ... I don't understand what it means to 'traverse from F to S' or what exactly you did with x+1 and concatenation. But if you have a number in the 'Sum of error' column and you want to translate that error into some other code based on a table, check out the VLOOKUP function. It's an XL function that can be used in VBA through Application.Worksheetfunction.VLookup() -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... I have the following: F | G| H | I | J |K .... to T Sum of Error 1 2 4 3 1 1 1 3 2 1 1 1 2 4 1 2 3 1 1 1 1 1 1 0 4 . The numbers represent error codes. Up to now I have created a vba macro that creates an array for each learner with the number of errors they got. I now need to match the error codes against another table in another worksheet. How do I traverse from F to S ? ie what methods are available and the syntax please. Going down to get the error was easy as I created an index and did x + 1 and concatenate this to the column Letter but I am not sure how to traverse across. Regards in advance Peter |
All times are GMT +1. The time now is 05:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com