Block IF? (VBA excel 2003/2007)

Epic786

New Member
Joined
May 6, 2013
Messages
4
Well I am running some code and it keeps saying block if!
how do u make a block if function cus i cant seem to correct it
thx for ur help in advance
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
If number = 0 Then Stars = ""
End If
If number = 1 Then Stars = "*"
End If
If number = 2 Then Stars = "**"
End If
If number = 3 Then Stars = "***"
End If
If number = 4 Then Stars = "****"
End If
If number = 5 Then Stars = "*****"
End If
 
Last edited:
Upvote 0
Well I am running some code and it keeps saying block if!
how do u make a block if function cus i cant seem to correct it
thx for ur help in advance
If number = 0 Then Stars = ""
End If
If number = 1 Then Stars = "*"
End If
If number = 2 Then Stars = "**"
End If
If number = 3 Then Stars = "***"
End If
If number = 4 Then Stars = "****"
End If
If number = 5 Then Stars = "*****"
End If
 
Upvote 0
Hi

You're welcome.

Good luck with your project.

ps It was reporting the Block If because the "End If" was superfluous as the "If ..Then" was a one-liner.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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