PrimoVongol
New Member
- Joined
- Feb 8, 2019
- Messages
- 2
Hello,
I am looking to to generate a list of values in a worksheet based on if the cells are coloured in other worksheets. I've posted the code below. My thinking is that in the first worksheet, the first cell will check if C1R1 of another worksheet has a filled background or no fill. if filled (regardless of colour) it will copy the value and then increment down a cell and run the again on the next one. I have an extra variable (b) in case i need it.
Sub Opening_Order()
'
' Opening_Order Macro
' Pulls highlighted cells from other worksheets
'
' Variables
Dim n As Integer 'Sheet variable
Dim x As Integer 'Survey Column variable
Dim y As Integer 'Survey Row Variable
Dim a As Integer 'Column variable
Dim b As Integer 'Row variable
a = 1
For n = 2 To 2
For x = 1 To 5
For y = 1 To 5
If Worksheets.Cells(x, y).Interior.ColorIndex <> 70 Then
Cells(a, 1).Value = Worksheets.Cells(x, y)
a = a + 1
End If
Next y
Next x
Next n
'
End Sub
I am looking to to generate a list of values in a worksheet based on if the cells are coloured in other worksheets. I've posted the code below. My thinking is that in the first worksheet, the first cell will check if C1R1 of another worksheet has a filled background or no fill. if filled (regardless of colour) it will copy the value and then increment down a cell and run the again on the next one. I have an extra variable (b) in case i need it.
Sub Opening_Order()
'
' Opening_Order Macro
' Pulls highlighted cells from other worksheets
'
' Variables
Dim n As Integer 'Sheet variable
Dim x As Integer 'Survey Column variable
Dim y As Integer 'Survey Row Variable
Dim a As Integer 'Column variable
Dim b As Integer 'Row variable
a = 1
For n = 2 To 2
For x = 1 To 5
For y = 1 To 5
If Worksheets.Cells(x, y).Interior.ColorIndex <> 70 Then
Cells(a, 1).Value = Worksheets.Cells(x, y)
a = a + 1
End If
Next y
Next x
Next n
'
End Sub