I have a pivottable and would like to select any cell in table range in column D that is equal to Cells in column A that are blank or not blank. here is what I wrote and ofcourse not working.
can you help me, please?
can you help me, please?
Code:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"> [COLOR=#00008B]Function[/COLOR] Fromatting()
[COLOR=#00008B]Dim[/COLOR] ws [COLOR=#00008B]As[/COLOR] Worksheet
[COLOR=#00008B]Set[/COLOR] ws = ThisWorkbook.Sheets([COLOR=#800000]"Detailed Report"[/COLOR])
[COLOR=#808080]'Set entire column "D" to %[/COLOR]
ws.Columns([COLOR=#800000]"D"[/COLOR]).Style = [COLOR=#800000]"Percent"[/COLOR]
[COLOR=#808080]'Set Cells in Column D to textFormat Where they are equal to empty Cells or non empty cells in Column A[/COLOR]
'Select range dynamically
[COLOR=#00008B]If[/COLOR] IsEmpty(ws.range([COLOR=#800000]"A5"[/COLOR], ws.range([COLOR=#800000]"A5"[/COLOR]).[COLOR=#00008B]End[/COLOR](xlDown)).Value) [COLOR=#00008B]Then[/COLOR]
ws.range([COLOR=#800000]"D5"[/COLOR], ws.range([COLOR=#800000]"D5"[/COLOR]).[COLOR=#00008B]End[/COLOR](xlDown)).[COLOR=#00008B]Select[/COLOR].NumberFormat = [COLOR=#800000]"@"[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]Function[/COLOR]</code>