macro to clear data below below

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,566
Office Version
  1. 2021
Platform
  1. Windows
I have a Pivot Table on sheet "Summary"

col A & B form part of the pivot Table & Col C contains formula's


I would like a macro to clear all data in Col C in the rows below where Grand total appears in Col A



Your assistance in this regard is most appreciated
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
so check col A for grand total, if not found do nothing

when found do nothing but set Z1 to 1

now if z1=1 delete value in c

it is a very simple macro - can you write it ?
 
Upvote 0
valuesorig datavalues
37.737.7
47.947.9
58.158.1
grand total128.3grand total128.3
8.5
8.7
8.9
9.1
9.3
9.5
9.7
this macro altered your table
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 13/02/2018 by bob
'
'
For j = 2 To 12
50 If Cells(j, 1) = "grand total" Then Cells(1, 26) = 1: GoTo 100
If Cells(1, 26) = 1 Then Cells(j, 3) = ""
100 Next j
Cells(1, 26) = ""
End Sub

<colgroup><col><col span="13"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

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