Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ty Ty is offline
external usenet poster
 
Posts: 72
Default Macro & VB101 and Excel

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Macro & VB101 and Excel

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.



  #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.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Macro & VB101 and Excel


Cross posted he
'Yahoo! Groups'
(http://tech.groups.yahoo.com/group/m.../message/35293)

Ty;435112 Wrote:
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.



--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=120533

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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM


All times are GMT +1. The time now is 01:07 PM.

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

About Us

"It's about Microsoft Excel"