Consulting

Results 1 to 5 of 5

Thread: Solved: Worksheet Change Function: Created WS?

  1. #1

    Solved: Worksheet Change Function: Created WS?

    Hello forum! I'm a bit of a VBA newbie as most of what I've learned has come from Google.

    ...that said, I have a macro that creates a pivot table on a new sheet; I've also coded in a couple of slicers at the top however the formatting on the pivot goes away once the user selects an item in the slicer. I want to use the worksheet change function on a range of cells to ensure once the user selects a separate item in the slicer that the formatting is consistent (behind the scenes).

    Is there a way to do the worksheet change function on a newly created WS?

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    why not show us your code ?

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    You could check out the
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    event which is a ThisWorkbook code-module thing. You just need to examine the Sh object which is the sheet being changed.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    The code is saved and attained from the user's personal.xlsb workbook and is not specific to a given workbook/worksheet.

  5. #5
    I'm trying to keep the format (currency) in the output values (Sum of the $$ amount)...realized this morning I can apply the currency format when creating the pivot and assigning the $$ amount as the output values rather than changing the format of the rows.

    Silly me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •