+ Reply to Thread
Results 1 to 6 of 6

Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

Hybrid View

  1. #1
    Registered User
    Join Date
    12-25-2016
    Location
    Africa,Zambia
    MS-Off Ver
    2010
    Posts
    3

    Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

    I start using recently excel VBA programming can you help me to solve my problem please?

    i want to know how to divide with VBA coding
    the value of 60 to one time 50 and one time 10,
    or the value of 70 to one time 50 and two times 10,
    or the value of 80 to one time of 50 and three times of 10,
    or the value of 90 to one time of 50 and four times .

    can you give an example please?

    'lets say' IF Range("A1").Value = 60

    ' times of 50 result come to' Then 1 =Range("B1").value
    ' times of 10 result come to' Then 1 =Range("C1").value

    lets say IF Range("A1").Value = 70

    ' times of 50 result come to' Then 1 =Range("B1").value
    ' times of 10 result come to'Then 2 =Range("C1").value

    lets say IF Range("A1").Value = 80

    ' times of 50 result come to Then' 1 =Range("B1").value
    ' times of 10 result come to Then' 3 =Range("C1").value

    lets say IF Range("A1").Value = 90

    ' times of 50 result come to Then' 1 =Range("B1").value
    ' times of 10 result come to Then' 4 =Range("C1").value

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

    Maybe :
    Sub Test()
      [B1] = [A1] \ 50
      [C1] = ([A1] - [B1] * 50) \ 10
    End Sub
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    12-25-2016
    Location
    Africa,Zambia
    MS-Off Ver
    2010
    Posts
    3

    Re: Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

    Thank you very much .
    You really solve my question!!

  4. #4
    Registered User
    Join Date
    12-25-2016
    Location
    Africa,Zambia
    MS-Off Ver
    2010
    Posts
    3

    Re: Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

    And if i want it in fx formula? The same please

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

    You are welcome.

    Formula on B1:
    Formula: copy to clipboard
    =INT(A1/50)


    Formula on C1:
    Formula: copy to clipboard
    =INT((A1-B1*50)/10)

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Divide a value 60 or 70 or 80 or 90 with divisor of 50 and 10 vba excel coding.

    If you want a formula solution, put =FLOOR(A1,50)/50 in B1 and =FLOOR(MOD(A1, 50), 10)/10 in C1
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 10-04-2014, 12:39 PM
  2. [SOLVED] Can a function be modified to accept a divisor?
    By Vba Novice in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-12-2013, 04:14 PM
  3. Incrementing divisor in rows
    By Geowit in forum Excel General
    Replies: 19
    Last Post: 08-07-2012, 01:07 PM
  4. division/divisor method name
    By pike in forum Excel General
    Replies: 2
    Last Post: 11-21-2011, 05:41 AM
  5. Change MOD divisor on-the-fly
    By Martindelica in forum Excel General
    Replies: 10
    Last Post: 04-08-2007, 03:12 PM
  6. Mod(number;divisor)
    By Mhek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2006, 09:45 AM
  7. Mod(number;divisor)
    By Mhek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2006, 09:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1