Hi there,
I'm currently working on a macro that tallies each "A", "G", and "S" that occurs in a column. So, if a cell's contents was "AG", I would like variables atally and gtally to each get +1 to their value. I would also like atally and gtally to each get +1 if the contents are "GA" as well.
I initially only had to work with "G" and "S", and used a "B" to indicate *both G & S*, but the introduction of a new value "A" screws things up big time.
Currently, my relevant portion of the macro is essentially:
(This macro starts by selecting the first cell value of the column and moves down to the next cell right before it loops)
![]()
Do until Selection.Value= "" If selection.value= "G" then gtally = gtally + 1 elseif selection.value="S" then stally = stally + 1 elseif selection.value="B" then gtally = gtally + 1 stally = stally + 1 end if Selection.Offset(1, 0).Select Loop
What I would like it to look like is this:
How do I do this?![]()
Do until Selection.Value= "" If the cell contains the character "G" then gtally = gtally + 1 elseif the cell contains the character "S" then stally = stally + 1 elseif the cell contains the character "A" then atally = atally + 1 end if Selection.Offset(1, 0).Select Loop











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks