revise VBA code to work with another set of data

Estatefinds

Board Regular
Joined
Sep 14, 2015
Messages
169
So for the following data: The individual alpha numerical values are in columns BX Through CB.
so I need THIS macro to be revised to list the remaining uncolored alpha numeric data but instead of the alpha numeric its self listed it would be the position in which it sits. and place the list in column CC on the same row its starts reading the data from top to bottom. please thank you!!!
Code is way at the bottom.








BWBXBYBZCACBCC
C9-C6-E1-D14-D8C9C6E1D14D8
A1-B1-C1-B4-D6A1B1C1B4D6
A15-B19-A14-C1-D1A15B19A14C1D1
A35-D1-D9-E4-D7A35D1D9E4D7
A4-A7-A15-C7-E6A4A7A15C7E6
A7-B5-B3-B2-D6A7B5B3B2D6
A7-B23-C1-C2-C4A7B23C1C2C4
B10-B8-B4-D2-D11B10B8B4D2D11
B18-B8-C4-E6-E1B18B8C4E6E1
B22-A1-C17-D6-E9B22A1C17D6E9
C11-C39-C17-E5-E3C11C39C17E5E3
A7-B1-D2-E1-E5A7B1D2E1E5
B1-C4-D17-C2-E9B1C4D17C2E9
A8-A2-A1-C5-E4A8A2A1C5E4
D2-C1-D6-E6-E9D2C1D6E6E9
B10-C7-C4-D2-D7B10C7C4D2D7
C1-B4-B3-B20-E17C1B4B3B20E17
A3-A12-C6-D11-E5A3A12C6D11E5
A4-D3-E9-D1-E1A4D3E9D1E1
B3-C5-C1-E10-E6B3C5C1E10E6
A4-A20-D4-D13-E25A4A20D4D13E25
A2-B2-A12-D5-D9A2B2A12D5D9
C9-B11-D1-E12-E2C9B11D1E12E2
A2-B1-B7-B14-E12A2B1B7B14E12
A4-C1-C6-C4-D1A4C1C6C4D1
A1-A2-A7-E3-E40A1A2A7E3E40
A4-B1-C3-D6-D1A4B1C3D6D1
A8-A14-B1-E4-C13A8A14B1E4C13
A3-C8-C6-C13-E2A3C8C6C13E2
B13-B17-C3-C16-D6B13B17C3C16D6
B30-B2-D1-D20-E2B30B2D1D20E2
B7-A3-C11-D29-C2B7A3C11D29C2
C6-B33-D6-C5-E22C6B33D6C5E22
A4-A3-B1-D1-E4A4A3B1D1E4
B1-D17-D6-C1-E2B1D17D6C1E2
B4-A10-D1-E4-E3B4A10D1E4E3
C10-E6-D1-D3-D5C10E6D1D3D5
C2-B8-D16-B4-E7C2B8D16B4E7
A9-A1-B15-B2-E3A9A1B15B2E3
A4-A3-C8-E1-D6A4A3C8E1D6
A10-D2-C10-C4-D4A10D2C10C4D4
B10-D7-E22-D15-E2B10D7E22D15E2
A2-B7-B1-C1-D1A2B7B1C1D1
B4-B1-D3-B14-E7B4B1D3B14E7
B27-A13-E2-E14-E20B27A13E2E14E20

<colgroup><col><col span="5"><col></colgroup><tbody>
</tbody>




A1B1C1D1E1
A2B2C2D2E2
A3B3C3D3E3
A4B4C4D4E4
A5B5C5D5E5
A6B6C6D6E6
A7B7C7D7E7
A8B8C8D8E8
A9B9C9D9E9
A10B10C10D10E10
A11B11C11D11E11
A12B12C12D12E12
A13B13C13D13E13
A14B14C14D14E14
A15B15C15D15E15
A16B16C16D16E16
A17B17C17D17E17
A18B18C18D18E18
A19B19C19D19E19
A20B20C20D20E20
A21B21C21D21E21
A22B22C22D22E22
A23B23C23D23E23
A24B24C24D24E24
A25B25C25D25E25
A26B26C26D26E26
A27B27C27D27E27
A28B28C28D28E28
A29B29C29D29E29
A30B30C30D30E30
A31B31C31D31E31
A32B32C32D32E32
A33B33C33D33E33
A34B34C34D34E34
A35B35C35D35E35
A36B36C36D36E36
A37B37C37D37E37
A38B38C38D38E38
A39B39C39D39E39
A40B40C40D40E40
A41B41C41D41E41
A42B42C42D42E42
A43B43C43D43E43
A44B44C44D44E44
A45B45C45D45E45
A46B46C46D46E46
A47B47C47D47E47
A48B48C48D48E48
A49B49C49D49E49
A50B50C50D50E50
A51B51C51D51E51
A52B52C52D52E52
A53B53C53D53E53
A54B54C54D54E54
A55B55C55D55E55
A56B56C56D56E56
A57B57C57D57E57
A58B58C58D58E58
A59B59C59D59E59
A60B60C60D60E60
A61B61C61D61E61
A62B62C62D62E62
A63B63C63D63E63
A64B64C64D64E64
A65B65C65D65E65
A66B66C66D66E66
A67B67C67D67E67
A68B68C68D68E68
A69B69C69D69E69
A70B70C70D70E70
A71B71C71D71E71
A72B72C72D72E72
A73B73C73D73E73
A74B74C74D74E74
A75B75C75D75E75
A76B76C76D76E76
A77B77C77D77E77
A78B78C78D78E78
A79B79C79D79E79
A80B80C80D80E80
A81B81C81D81E81
A82B82C82D82E82
A83B83C83D83E83
A84B84C84D84E84
A85B85C85D85E85
A86B86C86D86E86
A87B87C87D87E87
A88B88C88D88E88
A89B89C89D89E89
A90B90C90D90E90
A91B91C91D91E91
A92B92C92D92E92
A93B93C93D93E93
A94B94C94D94E94
A95B95C95D95E95
A96B96C96D96E96
A97B97C97D97E97
A98B98C98D98E98
A99B99C99D99E99
A100B100C100D100E100

<colgroup><col width="62" span="5" style="width:47pt"> </colgroup><tbody>
</tbody>


Sub ListCells()
Dim FirstRow As Long, ResultRow As Long, r As Long, c As Long


FirstRow = -1
For r = 1 To 1000
If Cells(r, "BB") <> "" Then
If FirstRow = -1 Then
FirstRow = r - 1
ResultRow = r
End If
For c = 54 To 58
If Cells(r, c).Interior.ColorIndex = xlNone Then
Cells(ResultRow, "BH") = Chr(c + 11) & r - FirstRow
ResultRow = ResultRow + 1
End If
Next c
End If
Next r

End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try this:
Rich (BB code):
Sub ListCells()
Dim FirstRow As Long, ResultRow As Long, r As Long, c As Long
Dim SearchRange As Range, ResultRange As Range, SearchCol As Long, ResultCol As Long


    Set SearchRange = Range("BX1")
    Set ResultRange = Range("CC1")
    SearchCol = SearchRange.Column
    ResultCol = ResultRange.Column
    
    FirstRow = -1
    For r = 1 To 1000
        If Cells(r, SearchCol) <> "" Then
            If FirstRow = -1 Then
                FirstRow = r - 1
                ResultRow = r
            End If
            For c = SearchCol To SearchCol + 4
                If Cells(r, c).Interior.ColorIndex = xlNone Then
                    Cells(ResultRow, ResultCol) = Chr(c - SearchCol + 65) & r - FirstRow
                    ResultRow = ResultRow + 1
                End If
            Next c
        End If
    Next r


End Sub
It's immaterial whether the data is numeric or alphanumeric, since we're just looking at the highlighting. The search column and result column are in red in the code so you can adapt this to other locations if you need to.
 
Upvote 0
Thank you very much!!!!:) I appreciate it!!!!!

I have one more request , please.
using same code and same columns of data, but this time listing the actual data and result it to column CD.
Thank you in advance!!!
 
Upvote 0
Rich (BB code):
Sub ListCells()
Dim FirstRow As Long, ResultRow As Long, r As Long, c As Long
Dim SearchRange As Range, ResultRange As Range, SearchCol As Long, ResultCol As Long


    Set SearchRange = Range("BX1")
    Set ResultRange = Range("CD1")
    SearchCol = SearchRange.Column
    ResultCol = ResultRange.Column
    
    FirstRow = -1
    For r = 1 To 1000
        If Cells(r, SearchCol) <> "" Then
            If FirstRow = -1 Then
                FirstRow = r - 1
                ResultRow = r
            End If
            For c = SearchCol To SearchCol + 4
                If Cells(r, c).Interior.ColorIndex = xlNone Then
                    Cells(ResultRow, ResultCol) = Cells(r, c).Value
                    ResultRow = ResultRow + 1
                End If
            Next c
        End If
    Next r


End Sub
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top