• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

extract certain data ,,,

febausa

Member
I need formula extract certain data and make new cells .


I want to extract (from columns A:F) and make new cells (columns H:M); that contain only the certain data extracted original data (columns A:F) are those rows that contain data in bold black color.


I attach the manually sample (columns H:M).


Thank you for your help.
 

Attachments

In a VBA approach you could try this..

Code:
Sub extract()

Dim rng As Range
Dim h As Integer: h = 2

Set rng = [A2:A19]
[H1:M1].Value = [A1:F1].Value

For Each r In rng
    If r.Font.Bold = True Then
        r.Resize(, 6).Copy Cells(h, "H")
        h = h + 1
    End If
Next

End Sub
 
Another logic...

Code:
Sub extract2()

Dim rng As Range
Dim h As Integer: h = 2
Dim i As Integer: i = 2

Set rng = [A2:A19]
[H1:M1].Value = [A1:F1].Value

For h = 6 To rng.Rows.Count Step 6
    Range("H" & i & ":M" & i).Value = Range("A" & h & ":F" & h).Value
        i = i + 1
Next

End Sub
 
Hi febausa,

You haven't explained what's the logic behind the output!!!

However try the VBA code posted @ #4 OR

try below in I2 and drag right/down.

I2 =LOOKUP($H2,$A$2:$A$13,B$2:B$13)

or I2:m4

I2 = LOOKUP($H2,$A$2:$A$13,INDEX($B$2:$F$13,,COLUMN()-8))
 

Attachments

Hi febausa,

You haven't explained what's the logic behind the output!!!

However try the VBA code posted @ #4 OR

try below in I2 and drag right/down.

I2 =LOOKUP($H2,$A$2:$A$13,B$2:B$13)

or I2:m4

I2 = LOOKUP($H2,$A$2:$A$13,INDEX($B$2:$F$13,,COLUMN()-8))

Hi Deepak:

Excuse for my mistake.

I attached new file for explain the logic.

Thank you for your help.

Febausa
 

Attachments

In a VBA approach you could try this..

Code:
Sub extract()

Dim rng As Range
Dim h As Integer: h = 2

Set rng = [A2:A19]
[H1:M1].Value = [A1:F1].Value

For Each r In rng
    If r.Font.Bold = True Then
        r.Resize(, 6).Copy Cells(h, "H")
        h = h + 1
    End If
Next

End Sub

Hi Deepak:

Your recommendation #4 VBA working well, thankyou for your help.

Febausa
 
In a VBA approach you could try this..

Code:
Sub extract()

Dim rng As Range
Dim h As Integer: h = 2

Set rng = [A2:A19]
[H1:M1].Value = [A1:F1].Value

For Each r In rng
    If r.Font.Bold = True Then
        r.Resize(, 6).Copy Cells(h, "H")
        h = h + 1
    End If
Next

End Sub

Deepak:

Thank you , your VBA formula working ver well.

Febausa
 
Back
Top