Call Private Sub based on Checked Cells

largeselection

Active Member
Joined
Aug 4, 2008
Messages
358
I have a macro that copies/pastes information based on checked cells in a first sheet. That portion is called "BUILDER".

I initiate that using a private sub which makes checkmarks in the cells. This is the code for that:

Code:
    <IF target.Column>Private Sub Worksheet_SelectionChange(ByVal target As Range)
    If target.Column > 1 Then Exit Sub
    If target.Row < 3 Then Exit Sub
    If target.Row > 4084 Then Exit Sub
    If target.Count > 1 Then Exit Sub
    If IsEmpty(target) Then
        target.Formula = "=CHAR(252)"
        target.Value = target.Value
        With target.Font
            .Name = "Wingdings"
            .FontStyle = "Bold"
            .Size = 8
        End With
 
    Else
 
    target.ClearContents
 
    End If
 
If Not IsEmpty(target) Then
        Select Case target.Address
Case "$A$3"
Builder "B"

I wanted to put in a button so that I can filter, then checkmark the visible cells. I have the code to do that, but it won't initiate the "BUILDER" macro when checked:

Code:
Sub SelectVisible()
Range("A3:A4083").Select
selection.SpecialCells(xlCellTypeVisible).Select
    selection.Formula = "=CHAR(252)"
    selection.Value = selection.Value
    With selection.Font
        .Name = "Wingdings"
        .FontStyle = "Bold"
        .Size = 8
    End With
 
End Sub

Forgive me for the simple question, but I'm a beginner. I'm sure it has something to do with not specifying a target when I run the "SelectVisible" code? I've already tried application run or call to try and use the private sub, but they aren't working (again I imagine because I don't specify a target?).

<SUB p SelectVisible()<><?XML:NAMESPACE PREFIX = Range("A3 /><Range("A3:A4083").Select< p></SUB>
</Range("A3:A4083").Select<>
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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