View Single Post
 
Old 02-24-2015, 09:20 AM
dapeamel dapeamel is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Feb 2015
Location: sweden
Posts: 10
dapeamel is on a distinguished road
Smile Copying specific cells to a new sheets also give sheetname

Hi guys,

I have a function that loops through all the sheets in a excel document
I return the name of the sheets,

See code below:

Sub WorksheetLoop()

Dim WS_Count As Integer
Dim I As Integer


WS_Count = ActiveWorkbook.Worksheets.Count


' Begin the loop.
For I = 1 To WS_Count


' Insert your code here.
'MsgBox ActiveWorkbook.Worksheets(I).Name

Next



Now I need a function

my exceldocument contain over 30 different columns "CAT", "DOG", "BIRD" ,"HORSE" etc.


I need a script that check after a certain cell-color (Blue, RGB 0,112,192)


when it finds the first blue cell,

the script copying the blue cell + the first word in the same column, the word is always on row 1, also copying the word in column B in the same row to the same place but in a new sheet,
the script also copying cell from the same column it finds the blue cell on, the first row cell and give it as name on the sheet it creats


so example see pictures



this is a orginal excel document




example result 1


example result 2



Could someone help me out ?

Thank you in advance
Reply With Quote