PDA

View Full Version : Solved: Worksheet Change Function: Created WS?



BravesPiano5
02-23-2013, 07:09 PM
Hello forum! I'm a bit of a VBA newbie as most of what I've learned has come from Google. :whistle:

...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?

patel
02-24-2013, 02:32 AM
why not show us your code ?

p45cal
02-24-2013, 05:44 AM
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.

BravesPiano5
02-24-2013, 11:14 AM
The code is saved and attained from the user's personal.xlsb workbook and is not specific to a given workbook/worksheet.

BravesPiano5
02-25-2013, 07:22 AM
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. :rotlaugh: