Loop in decimels instead of regular numbers.

countryfan_nt

Well-known Member
Joined
May 19, 2004
Messages
765
Hello friends, Hope all is well!

Please kindly help me with the code below.
1. Can I make it faster?
2. I want the loop to be run on decimels (e.g. 0.1, 0.2, …1.1,1.2 etc.)

Highly appreciate it in advance!

Code:
Option Explicit

Sub animatedLineChart()

Application.ScreenUpdating = False

Sheets("bmi").Range("A33").Value = 0

 ActiveSheet.ChartObjects("Chart 2").Select
 'ActiveChart.Axes(xlValue).Select
 ActiveChart.Axes(xlValue).MinimumScale = 0

Range("A1").Select

Application.ScreenUpdating = False

    Dim i As Integer
    Dim XValue As Integer
    For i = 0.01 To Sheets("bmi").Range("B33").Value
        Worksheets("bmi").Range("xValue") = Format(i, "0.00")
        DoEvents
    
 Application.ScreenUpdating = True
    
    Next i

Range("A1").Select
End Sub
 
Last edited:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Thank you very much! I tried the below code, but I it is not fast enough; can it be? please help.

Code:
Sub DoWhileDemo()

Sheets("bmi").Range("b1").ClearContents

Range("A1").Select

Do Until Sheets("bmi").Range("c1").Value = True
Sheets("BMI").Range("B1").Value = Sheets("BMI").Range("B1").Value + 1.5
  DoEvents 'Wait for things to update
  Application.Wait (Now() + CDate("00:00:01")) / 500
  Loop
  
Application.ScreenUpdating = False
    Range("E1").Select
    Selection.Copy
    Range("B1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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