code updating - can anyone help

sleepers

Board Regular
Joined
May 26, 2004
Messages
203
i have this great code that you guys helped me with before and works fine - now i need it not to show thursday or sunday dates in the output page. These codes set two pages, one that lists just the d in a row and the other that lists the dd d format. see images. i need them to excluse the thu and sun? can anyone help??


Code:
Function ConcatMth(rng As Range, item As String, Optional dte = True)
    Application.Volatile
    For Each ce In rng
        If ce <> "" And Sheets(rng.Parent.Name).Cells(2, ce.Column) = item Then
            If dte Then
                holder = holder & Format(ce, "d") & ","
            Else
                holder = holder & ce & ","
            End If
        End If
    Next ce
    ConcatMth = Left(holder, Len(holder) - 1)
End Function




Function ConcatMth2(rng As Range, item As String, Optional dte = True)
    Application.Volatile
    For Each ce In rng
        If ce <> "" And Sheets(rng.Parent.Name).Cells(2, ce.Column) = item Then
            If dte Then
                holder = holder & Format(ce, "ddd d") & ","
            Else
                holder = holder & ce & ","
            End If
        End If
    Next ce
    ConcatMth2 = Left(holder, Len(holder) - 1)
End Function

http://www.whirlwindent.com/help/image1.pdf
http://www.whirlwindent.com/help/image2.pdf
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Change:

Code:
holder = holder & Format(ce, "d") & ","

to

Code:
If Format(ce.value,"dddd") <> "Thursday" And Format(ce.value,"dddd")<> "Sunday"  then holder = holder & Format(ce.value, "d") & ","
 
Upvote 0

Forum statistics

Threads
1,219,161
Messages
6,146,657
Members
450,706
Latest member
LGVBPP

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