FormControl Scroll Bar_Multiply the Value

harishs

Board Regular
Joined
Jul 3, 2016
Messages
50
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Experts,

I am using following code in a Form Control - Scroll Bar to get Min & Max value from a cell (has formula) to another cell as values.

My Cell Value varies between 0 - 50,000... I believe scroll bar has a limitation up to 30,000 hence I am dividing my values by 10.
Eg: 50,000 to 5,000 and 30,000 to 3,000

Now, I want these values to be pasted into the desired cell by multiplying by 10.
5,000 to 50,000 and 3,000 to 30,000

Code:
Code:
Sub testing()
    Dim Bar As ScrollBar
    Dim Mybk As Workbook: Set Mybk = ThisWorkbook
    Dim Sht As Worksheet: Set Sht = Mybk.Sheets("test_Sheet")
           
    Set Bar = Sht.ScrollBars("Scroll Bar 10")
        With Bar 'values will be placed in cell AM16:AR16
        .Max = 5000
        .Min = 1000
        .SmallChange = 500
        .LargeChange = 500
    End With
        Sht.Range("AM16:AR16").Copy
        Sht.Range("AC16:AH16").PasteSpecial xlPasteValues
        Application.CutCopyMode = False
End Sub

how do I multiply values by 10 while pasting?

Regards,
Harish S
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Sorry about that, but as I may have raised your hopes try:

Code:
Sub testing()
    Dim Bar As ScrollBar, cl As Long
    Dim Mybk As Workbook: Set Mybk = ThisWorkbook
    Dim Sht As Worksheet: Set Sht = Mybk.Sheets("test_Sheet")
           
    Set Bar = Sht.ScrollBars("Scroll Bar 10")
    With Bar 'values will be placed in cell AM16:AR16
        .Max = 5000
        .Min = 1000
        .SmallChange = 500
        .LargeChange = 500
    End With
    For cl = 29 To 34
        Sht.Cells(16, cl + 10) = Sht.Cells(16, cl) * 10
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,882
Messages
6,175,166
Members
452,615
Latest member
bogeys2birdies

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