Consulting

Results 1 to 5 of 5

Thread: dividing a number into a given range

  1. #1
    VBAX Newbie
    Joined
    Jan 2021
    Location
    Berlin
    Posts
    5
    Location

    dividing a number into a given range

    hi i want to divide a range to a number here is the photo i dont want to do it with "Function" can u show with Dim or etc. and i want to get the answers as table like 5 units offset to the right or left i tried this

    Option Base 1

    Sub teilbar() Dim i As Integer, j As Integer Dim x As String
    If x Mod 3 = 0
    Then teilbar = "Teilbar 3"

    Else
    teilbar = "Nicht Teilbar"

    Cells(i, j + 5) = A(i, j + 5)
    End If

    Next j
    Next i
    End Sub
    Thanks for helping me

    111.png

  2. #2
    VBAX Newbie
    Joined
    Jan 2021
    Location
    Berlin
    Posts
    5
    Location
    i think im not good with the "arrays" :/

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    I have little idea what you're trying to do.
    Sub teilbar()
    Dim i As Integer, j As Integer
    Dim x, teilba
    
    For j = 1 To 3
      For i = 1 To 3
        If Cells(i, j).Value Mod 3 = 0 Then teilba = "Teilbar 3" Else teilba = "Nicht Teilbar"
        Cells(i, j + 5) = teilba
      Next i
    Next j
    End Sub
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    VBAX Newbie
    Joined
    Jan 2021
    Location
    Berlin
    Posts
    5
    Location
    Ty very muchh

    but i couldn't understant that , wenn should i use "Arrays" dont know exact meanings of arrays or ReDim ?
    thanks a lot again

  5. #5

Posting Permissions

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