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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,211,741
Messages
6,103,647
Members
447,875
Latest member
kaku_1728

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