# Need excel expert

#### kashif.special2005

##### Active Member
Hi,

I wanted the output like this.

*
* *
* * *
* * * *

Thanks & Regards,
Kashif.

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try like this

Code:
``````Sub Stars()
Dim i As Long
For i = 1 To 4
Cells(i, 1).Resize(, i).Value = "*"
Next i
End Sub``````

If you want all your asterisks in a single column, enter in row 1: =REPT("*", ROW()) and drag down.

If you want your asterisks in separate columns, enter in A1: =IF(COLUMN()<= ROW(), "*", "") and drag as far down and right as you like.

Last edited:
Only if you need all your asterisks in a single cell, will you be forced to use VBA. To extend VoG's solution above, you can use the following function:

Code:
``````Function Stars(num&) As String
Dim i&

For i = 1 To num
Stars = Stars & String(i, "*") & vbNewLine
Next i
Stars = Left(Stars, Len(Stars) - Len(vbNewLine))
End Function``````

Just make sure that you have wrap text on, otherwise you'll just get them all in a row.

I want to do this through procedure

I want to create prymide

like Capital A sign

kashif

To create a pyramid (all in one column), create a right triangle (like UniMord's formula) and then format the cells to align Center.

Hi,

Sorry to say, I am not able understand that.

If you have
A1 = "*"
A2 = "**"
A3 = "***"
A4 = "****"

it will look like a right triangle if A1:A4 are set to align Left (the default) but will look like an isosceles triangle if they are set to align center.

Replies
7
Views
93
Replies
2
Views
246
Replies
6
Views
175
Replies
4
Views
655
Replies
0
Views
274

### Forum statistics

1,203,491
Messages
6,055,727
Members
444,814
Latest member
AutomateDifficulty

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

### Which adblocker are you using?

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

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