View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ty Ty is offline
external usenet poster
 
Posts: 72
Default Macro & VB101 and Excel

On Jul 29, 6:43*am, "Bob Phillips" wrote:
Put a watch on it, DebugAdd Watch...

--
__________________________________
HTH

Bob

"Ty" wrote in message

...



VB101
Sub Duplicate Data ()
* '
* ' NOTE: You must select the first cell in the column and
* ' make sure that the column is sorted before running this macro
* '
* ScreenUpdating = False
* FirstItem = ActiveCell.Value
* SecondItem = ActiveCell.Offset(1, 0).Value
* Offsetcount = 1
* Do While ActiveCell < ""
* * *If FirstItem = SecondItem Then
* * * *ActiveCell.Offset(Offsetcount, 0).Interior.Color = RGB(255, 0,
0)
* * * *ActiveCell.Offset(Offsetcount - 1, 0).Interior.Color = RGB
(255, 0, 0)
* * * *Offsetcount = Offsetcount + 1
* * * *SecondItem = ActiveCell.Offset(Offsetcount, 0).Value
* * *Else
* * * *ActiveCell.Offset(Offsetcount, 0).Select
* * * *FirstItem = ActiveCell.Value
* * * *SecondItem = ActiveCell.Offset(1, 0).Value
* * * *Offsetcount = 1
* * *End If
* Loop
* ScreenUpdating = True
End Sub


It's been a long time. *I'm trying to refresh my memory on VB. *Is
there a way to view the counter?
I'm trying to understand each line by using debug to step through the
execution.- Hide quoted text -


- Show quoted text -


I know this might seem easy for most reading this. I want to view the
value of the counter. And this is the Offsetcount. Right??

Newbie Problem: I found it but a box came up with an Expression box.
Is the Offsetcount called an expression?

Note:: I used the help in Excel. But this seems greek to me, so far.

expression
A combination of keywords, operators, variables, and constants that
yields a string, number, or object. An expression can be used to
perform a calculation, manipulate characters, or test data.