+ Reply to Thread
Results 1 to 7 of 7

Do Until Cell IsEmpty

Hybrid View

fa888 Do Until Cell IsEmpty 10-14-2010, 10:07 PM
rylo Re: Do Until Cell IsEmpty 10-14-2010, 10:13 PM
fa888 Re: Do Until Cell IsEmpty 10-14-2010, 10:42 PM
rylo Re: Do Until Cell IsEmpty 10-14-2010, 11:13 PM
fa888 Re: Do Until Cell IsEmpty 10-19-2010, 11:29 PM
SDruley Re: Do Until Cell IsEmpty 10-15-2010, 08:27 AM
fa888 Re: Do Until Cell IsEmpty 10-19-2010, 11:26 PM
  1. #1
    Registered User
    Join Date
    10-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Do Until Cell IsEmpty

    I am trying to break up a bigger question into smaller bit so that I understand the steps.

    I have:

    Cell
    A1 = 1 B1 = 2
    A2 = 3 B2 = 4
    A3 = 5 B3 = 6

    How do I write a code such that

    E1 = A1 and F1 = B1
    Then
    E1 = A2 and F1 = B2
    Then
    E1 = A3 and F1 = B3
    Then
    It stops because A4 is empty.

    I really feel like a baby because I know what I want but find it hard to convey the message, I really hope someone would help me. I had a bigger problem which I had posted earlier but made no progress so I'm breaking down to this bit size first.

    Thanks.
    Last edited by fa888; 10-19-2010 at 11:27 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Do Until Cell IsEmpty

    Hi

    Here's one way. It doesn't look for a blank cell, but processes all the data in column A, regardless.

    Sub aaa()
      For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
        Range("E1").Resize(1, 2).Value = Cells(i, 1).Resize(1, 2).Value
    
      Next i
    End Sub
    Went back and looked at your earlier post and am not sure what you are trying achieve. Do you just want to output a list of all the pairings of the numbers from 1 to 45? As in 1,1; 1,2;...1,45; 2,3; 2,4; ...2,45; 3,4;...


    rylo
    Last edited by rylo; 10-14-2010 at 10:18 PM.

  3. #3
    Registered User
    Join Date
    10-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Do Until Cell IsEmpty

    Hi rylo,

    Thanks for your input, I will try to work it out. Meanwhile, my earlier post's object was to go down the list like you said .... 1,2;...1,45; 2,3; 2,4; ...2,45; 3,4;...

    Each time the 2 two numbers will fed into PAIRS!D1 and PAIRS!E1

    They are, in turn, equal to Analysis!BA19 and Analysis!BB19.

    Now, when they are fed into it, it churns out a value in Analysis!BF22 (from a countif forumla),

    Then I want to copy the value of Analysis!BF22 into PAIRS!C1.

    At the end of the day, I would like my PAIRS worksheet for be filled with column C which is the value of Analysis!BF22. (This cell is constant, always Analysis!BF22, though the value will change as different pairs give different values), corresponding to the different pair combos.

    I am looking at your code for now. Thanks.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Do Until Cell IsEmpty

    Hi

    If you just want a pairing listing then try

    Sub aaa()
      For i = 1 To 44
        For j = i + 1 To 45
          outrow = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
          Cells(outrow, 1).Value = i
          Cells(outrow, 2).Value = j
        Next j
      Next i
    End Sub
    Adjust the output place to suit.

    rylo

  5. #5
    Registered User
    Join Date
    10-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Do Until Cell IsEmpty

    Quote Originally Posted by rylo View Post
    Hi

    If you just want a pairing listing then try

    Sub aaa()
      For i = 1 To 44
        For j = i + 1 To 45
          outrow = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
          Cells(outrow, 1).Value = i
          Cells(outrow, 2).Value = j
        Next j
      Next i
    End Sub
    Adjust the output place to suit.

    rylo
    Thanks rylo, I can use this for other parts of my projects!

  6. #6
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Smile Re: Do Until Cell IsEmpty

    A possible solution is attached.
    Attached Files Attached Files
    Turn Data into Information
    Turn Information into Knowledge
    Turn Knowledge into Direction
    Turn Direction into Leadership
    Turn Leadership into Results
    Stephen Druley

    It's not how quickly you think
    But how deeply you think
    The quality of thinking is measured
    by remoteness to conformance
    Stephen Druley

  7. #7
    Registered User
    Join Date
    10-10-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Do Until Cell IsEmpty

    Thanks SDruley. You solved it.

+ 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