+ Reply to Thread
Results 1 to 5 of 5

I need help with arrays (Still)

  1. #1
    Registered User
    Join Date
    10-18-2005
    Posts
    16

    I need help with arrays (Still)

    I have a slight problem that Excel either can not do or I can not enter the formula correctly. I am asking for your expertise. What I need is to enter Value A into a cell and then enter Value B into a cell, have Excel do the division, and then generate a table with that number of rows. For example, if I enter "20" into cell A2, enter "5" into cell B2, I need Excel to generate a table in cell C4 that starts at 1 and then in cell D4 is 2, then 3 ....

    If further elaboration is needed, what I am looking for is this. If I have a distance of say 20 meters & I want to break it into 5 equal sections. I will enter 20 in cell A2 and enter 5 in cell A3. I want Excel to realize (from my input of 5) that I want 5 columns. Say I enter the "code" in cell C5 I want Excel to place a "1" in cell C5, & in cell D5, place a "2", in D6, place a "3"... until it reaches the nmber of sections that I asked for. I hope this is clear & I hope that someone can help.

    If you can help, please explain in as basic of terms as possible.

    Thank you

  2. #2
    Gary Keramidas
    Guest

    Re: I need help with arrays (Still)

    not sure if it can be done how you explain it. you need to have some sort of
    consistency with where you will be entering your numbers and where you want
    the results you mention a2 and a3 and then c4 in one paragraph and in the
    other you mention c5.

    maybe if you kept them all in the same row. maybe someone else can
    interpret what you mean, .but i need further explanation.
    --


    Gary


    "rbhedal" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a slight problem that Excel either can not do or I can not enter
    > the formula correctly. I am asking for your expertise. What I need is
    > to enter Value A into a cell and then enter Value B into a cell, have
    > Excel do the division, and then generate a table with that number of
    > rows. For example, if I enter "20" into cell A2, enter "5" into cell
    > B2, I need Excel to generate a table in cell C4 that starts at 1 and
    > then in cell D4 is 2, then 3 ....
    >
    > If further elaboration is needed, what I am looking for is this. If I
    > have a distance of say 20 meters & I want to break it into 5 equal
    > sections. I will enter 20 in cell A2 and enter 5 in cell A3. I want
    > Excel to realize (from my input of 5) that I want 5 columns. Say I
    > enter the "code" in cell C5 I want Excel to place a "1" in cell C5, &
    > in cell D5, place a "2", in D6, place a "3"... until it reaches the
    > nmber of sections that I asked for. I hope this is clear & I hope that
    > someone can help.
    >
    > If you can help, please explain in as basic of terms as possible.
    >
    > Thank you
    >
    >
    > --
    > rbhedal
    > ------------------------------------------------------------------------
    > rbhedal's Profile:
    > http://www.excelforum.com/member.php...o&userid=28199
    > View this thread: http://www.excelforum.com/showthread...hreadid=477787
    >




  3. #3
    Gary Keramidas
    Guest

    Re: I need help with arrays (Still)

    before i go any farther, see if this is a star t of what you are trying to
    do. put your values in a2 and b2 and run the macro


    Sub test()
    div = Application.Evaluate("=a2/b2")
    Debug.Print div
    Cells(2, 3).Resize(1, div).Activate
    i = 3
    For v = 1 To div
    Cells(2, i) = v
    i = i + 1
    Next
    v = v + 1
    End Sub

    --


    Gary


    "rbhedal" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a slight problem that Excel either can not do or I can not enter
    > the formula correctly. I am asking for your expertise. What I need is
    > to enter Value A into a cell and then enter Value B into a cell, have
    > Excel do the division, and then generate a table with that number of
    > rows. For example, if I enter "20" into cell A2, enter "5" into cell
    > B2, I need Excel to generate a table in cell C4 that starts at 1 and
    > then in cell D4 is 2, then 3 ....
    >
    > If further elaboration is needed, what I am looking for is this. If I
    > have a distance of say 20 meters & I want to break it into 5 equal
    > sections. I will enter 20 in cell A2 and enter 5 in cell A3. I want
    > Excel to realize (from my input of 5) that I want 5 columns. Say I
    > enter the "code" in cell C5 I want Excel to place a "1" in cell C5, &
    > in cell D5, place a "2", in D6, place a "3"... until it reaches the
    > nmber of sections that I asked for. I hope this is clear & I hope that
    > someone can help.
    >
    > If you can help, please explain in as basic of terms as possible.
    >
    > Thank you
    >
    >
    > --
    > rbhedal
    > ------------------------------------------------------------------------
    > rbhedal's Profile:
    > http://www.excelforum.com/member.php...o&userid=28199
    > View this thread: http://www.excelforum.com/showthread...hreadid=477787
    >




  4. #4
    Gary Keramidas
    Guest

    Re: I need help with arrays (Still)

    this is a little different approach
    Sub test()
    div = Application.Evaluate("=a2/b2")
    Debug.Print div
    With Cells(2, 3).Resize(1, div)
    i = 3
    For v = 1 To div
    Cells(2, i) = v
    i = i + 1
    Next
    v = v + 1
    End With
    End Sub

    --


    Gary


    "rbhedal" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a slight problem that Excel either can not do or I can not enter
    > the formula correctly. I am asking for your expertise. What I need is
    > to enter Value A into a cell and then enter Value B into a cell, have
    > Excel do the division, and then generate a table with that number of
    > rows. For example, if I enter "20" into cell A2, enter "5" into cell
    > B2, I need Excel to generate a table in cell C4 that starts at 1 and
    > then in cell D4 is 2, then 3 ....
    >
    > If further elaboration is needed, what I am looking for is this. If I
    > have a distance of say 20 meters & I want to break it into 5 equal
    > sections. I will enter 20 in cell A2 and enter 5 in cell A3. I want
    > Excel to realize (from my input of 5) that I want 5 columns. Say I
    > enter the "code" in cell C5 I want Excel to place a "1" in cell C5, &
    > in cell D5, place a "2", in D6, place a "3"... until it reaches the
    > nmber of sections that I asked for. I hope this is clear & I hope that
    > someone can help.
    >
    > If you can help, please explain in as basic of terms as possible.
    >
    > Thank you
    >
    >
    > --
    > rbhedal
    > ------------------------------------------------------------------------
    > rbhedal's Profile:
    > http://www.excelforum.com/member.php...o&userid=28199
    > View this thread: http://www.excelforum.com/showthread...hreadid=477787
    >




  5. #5
    Tom Ogilvy
    Guest

    Re: I need help with arrays (Still)

    You received an answer yesterday when you said you wanted rows.

    for column you would just alter the code

    Sub abc()
    If IsNumeric(Range("A2")) And IsNumeric(Range("B2")) And _
    Not IsEmpty(Range("B2")) Then
    If CLng(Range("B2")) <> 0 Then
    For i = 1 To Range("A2") / Range("B2")
    Range("C4").Offset(0,i-1).Value = i
    Next
    End If
    End If

    End Sub

    --
    Regards,
    Tom Ogilvy


    "rbhedal" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a slight problem that Excel either can not do or I can not enter
    > the formula correctly. I am asking for your expertise. What I need is
    > to enter Value A into a cell and then enter Value B into a cell, have
    > Excel do the division, and then generate a table with that number of
    > rows. For example, if I enter "20" into cell A2, enter "5" into cell
    > B2, I need Excel to generate a table in cell C4 that starts at 1 and
    > then in cell D4 is 2, then 3 ....
    >
    > If further elaboration is needed, what I am looking for is this. If I
    > have a distance of say 20 meters & I want to break it into 5 equal
    > sections. I will enter 20 in cell A2 and enter 5 in cell A3. I want
    > Excel to realize (from my input of 5) that I want 5 columns. Say I
    > enter the "code" in cell C5 I want Excel to place a "1" in cell C5, &
    > in cell D5, place a "2", in D6, place a "3"... until it reaches the
    > nmber of sections that I asked for. I hope this is clear & I hope that
    > someone can help.
    >
    > If you can help, please explain in as basic of terms as possible.
    >
    > Thank you
    >
    >
    > --
    > rbhedal
    > ------------------------------------------------------------------------
    > rbhedal's Profile:

    http://www.excelforum.com/member.php...o&userid=28199
    > View this thread: http://www.excelforum.com/showthread...hreadid=477787
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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