What does this excel macro do?

Hi,

What does this excel macro do?
Can anyone tell me what this exactly checks and gets...

REgards
Sharath

Sub Find_All_Users()
'Check for all CSC
'Local
Dim Cel As Range
 
thisWB = ActiveWorkbook.Name
Set row2 = ActiveSheet.Rows(2)
 
Workbooks.Add
newWB = ActiveWorkbook.Name
 
Workbooks(thisWB).Activate
row2.Copy
Workbooks(newWB).Activate
ActiveSheet.Paste
Workbooks(thisWB).Activate
 
ActiveSheet.Columns(5).Select
 
    For Each Cel In Selection
        If Cel.Interior.ColorIndex = 6 Then
            Cel.EntireRow.Copy
            Workbooks(newWB).Activate
            Range("A1").Select
            
                If ActiveCell.Offset(1, 0).Value = "" Then
                    ActiveCell.Offset(1, 0).EntireRow.Select
                    ActiveSheet.Paste
                Else
                    Selection.End(xlDown).Select
                    ActiveCell.Offset(1, 0).EntireRow.Select
                    ActiveSheet.Paste
                End If
            
            Workbooks(thisWB).Activate
        End If
    Next Cel
 
End Sub

Open in new window

LVL 11
bsharathAsked:
Who is Participating?
 
Rory ArchibaldConnect With a Mentor Commented:
It copies row 2 to a new workbook, then loops through each cell in column E and if the interior is yellow (colorindex 6), it copies that row to the new workbook as well, in the next available row.
Regards,
Rory
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Hello bsharath,

It copies row 2 of the activesheet in the containing workbook to a brand new wqorkbook.

It then continues to to copy every row from the original sheet where column F interior is colored an orangy yellow!

Regards,
Chris
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
bsharath,

Sorry Rory i'm wrong ... and slow!

chris_bottomley
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Rory ArchibaldCommented:
Chris,
No worries - that describes most of my day today! :)
Rory
0
 
bsharathAuthor Commented:
Thank U...
And this code... I am a bit confused on these 2 ...
Sub Mark_All_Paid()
'Mark all CSC
'Local
Dim rng As Range, cell As Range
Set rng = Range("E1:E" & Cells(65536, "E").End(xlUp).Row)
rng.ClearComments
For Each cell In rng
If (cell.Interior.ColorIndex = 6 And cell.Value <> "") Then
cell.AddComment Text:="CSC User"
End If
Next cell
 
 
End Sub

Open in new window

0
 
Rory ArchibaldCommented:
It removes the existing comments and then loops through all the cells in E and adds a comment "CSC user" if the cell is yellow and not blank.
0
 
bsharathAuthor Commented:
Thank U
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.