geometric progression on excel or vba

sandradepar

New Member
Joined
Jun 1, 2020
Messages
4
Office Version
  1. 2007
Platform
  1. Windows
Hi,
Can someone help me?

I know how to do a geometric progression on excel in vertical and horizontal lines for large sample such as 500 or 1000.

I don't know how to do a geometric progression on excel in diagonal lines for large sample such as 500 or 1000
GEO.JPG
. (i know how do it by fulfilling each cell at time, by it'll take an eternity to fulfilling each cell, this is the hard way). Here is a photo of the hard way. In the example the first trm of geometric progression is 100 and is increased by 1,07 each time.

Can someone show us the easiest way how to do a geometric progression on excel in diagonal lines for large sample such as 500 or 1000 on excel or a code for vba ?

Many thanks in advance
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to the forum!

I can't imagine what you'll use this for, but try this. Open a new workbook. Press Alt-F11 to open the VBA editor. Press Alt-IM to Insert a Module. Paste the following code in the window that opens.

VBA Code:
Sub GeoProg()
Dim MyCell As String, MyStart As Double, MyMult As Double, i As Long

    MyCell = InputBox("Enter the cell address on the active sheet to start: ")
    MyStart = InputBox("Enter the starting value: ")
    MyMult = InputBox("Enter the factor: ")
    For i = 0 To Range(MyCell).Row - 1
        Range(MyCell).Offset(-i, i) = MyStart
        MyStart = MyStart * MyMult
    Next i
End Sub

Press Alt-Q to close the editor. In Excel, press Alt-F8 to open the macro selector. Select Geoprog, and click run. Follow the prompts.

Hope this helps!
 
Upvote 0
This could be an option, put the formula in cell B2 and copy down until you find the cell with the number, in my example up to cell B9, then copy to the right until the number appears in the first row.

Cell Formulas
RangeFormula
B1:J9B1=IF(A2="","",A2*1.07)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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