Compile Error: Expected: list separator or)

reharris2

New Member
Joined
Jun 7, 2011
Messages
4
I am trying to create a self-cleaning pivot table that automatically deletes unwanted drill down tables. I have found some code through google; however, I keep getting a Compile Error: Expected: list separator or). Below, is the section that keeps producing the error:


Private Sub Workbook_SheetBeforeDoubleClick( _
ByVal Sh As Object, ByVal Target
As Range, _
Cancel As Boolean)
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try

Code:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
 
Upvote 0
You're missing line continuation on the second line, ending with Target:
Private Sub Workbook_SheetBeforeDoubleClick( _
ByVal Sh As Object, ByVal Target _
As Range, _
Cancel As Boolean)
 
Upvote 0
Hi ...

Im a newbie to VBA ..

While trying the following code, m getting <Expected:list separatr or )> error:


Private Sub CommandButton1_Click()
Range(“A1:A10").Value= ”Visual Basic“
Range(“C11”).Value = Range(“A11”).Value + Range(“B11”).Value
End Sub


Please help on this ...
 
Upvote 0
You have some strange " marks. Try copying and pasting this

Code:
Private Sub CommandButton1_Click()
Range("A1:A10").Value = "Visual Basic"
Range("C11").Value = Range("A11").Value + Range("B11").Value
End Sub
 
Upvote 0
Thnx a Ton Mr.Excel :) .... It is basic and will take care of such tings goin forward .... Thnx again :) ...
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

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