Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default traversing across columns in VBA

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
traversing a filtered range (excel 2007) parahumanoid Charts and Charting in Excel 3 November 2nd 09 08:11 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 2 July 31st 06 09:45 PM
Traversing two named rages of unequal length zestpt[_7_] Excel Programming 3 July 14th 04 05:56 PM
traversing through a filtered range based on another filtered range zestpt[_4_] Excel Programming 4 July 12th 04 06:37 PM
Traversing Rows Tom Ogilvy Excel Programming 0 August 20th 03 05:10 PM


All times are GMT +1. The time now is 12:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"