Hi basically i have a simple structure like this in excel
day of month operation
1
2 1
3 1
4 1
5
6
7 1
8 1
9
.
.
31
now it seems simple but i want to return the specified day of month row that has 1 in operation column.
so for example
2,3,4 and 7,8
ive been picking my brain all day and cant come up with a conclusion.
basically there are typical groups e.g 2,3,4 and 7,8
the final thing i want is to a put the results in a cell and "possiblity" use trim
because the end result i want is a range for the days that were worked so far
so
2,3,4 = 2-4 and 7,8 = 7-8
problem is it always needs to be in the format containing 2 digits
2-4 and 7-8
maybe a mod function is in order?
i have the following functions so far
code:
Option Explicit
Sub FindOpDays()
Dim LastRow As Long, r As Long, c As Integer
LastRow = Range("A65536").End(xlUp).Row
c = 6
For r = 2 To LastRow
If Cells(r, 2) = 1 Then
Cells(2, c) = Cells(r, 1)
c = c + 1
End If
Next r
End Sub
any help would be great
Bookmarks