Hi guys,
I have created following code,
the code looks for a certain value of a colorINDEX=23
I got a Msgbox that tells me the correct value of a certain cell, then I recieve the first cell in the column,
now I need a loop through all columns in each sheet,
then create new sheets with name of each certain value I recieve from the certain cell
see my code below
Thank you in advance
I have created following code,
the code looks for a certain value of a colorINDEX=23
I got a Msgbox that tells me the correct value of a certain cell, then I recieve the first cell in the column,
now I need a loop through all columns in each sheet,
then create new sheets with name of each certain value I recieve from the certain cell
see my code below
Code:
Sub Langauge_Combination()
For Each sht In ActiveWorkbook.Worksheets
Set Rng = sht.UsedRange
Set MyRange = Rng
For Each MyCol In MyRange.Columns
For Each Mycell In MyCol.Cells
'MsgBox ("Address: " & MyCell.Address & Chr(10) & "Value: " & MyCell.Value)
If Mycell.Interior.ColorIndex = 23 Then
MsgBox "Language is: " & MyCol.Cells(1, 1).Text 'When the loops go throughs I get this value, I want this value for each new sheet
'and if the sheet is created in the first time loop then go to next.
'MsgBox "" & Mycell.Column
'Cells(Mycell.Row, 2).Copy
'Mycell.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
'SkipBlanks:=False, Transpose:=False
End If
Next
Next
Next
End Sub
Thank you in advance