+ Reply to Thread
Results 1 to 11 of 11

run a sequence of numbers based on values found in 2 columns

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    56

    run a sequence of numbers based on values found in 2 columns

    I am hoping someone can help my out with this as i don't even know where to start.

    i'm after a macro that will loop through the column lets say A to identify blank cells and add the number 1 (i got this far)
    i then want it to look in the adjacent column B at the time and for all rows with same time, sequence the numbers in column A under the 1 added earlier but only for these rows under the blank cell with the same time.

    i hope that makes sense, i have added some data if it doesn't.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 04-20-2020 at 11:28 AM.

  2. #2
    Registered User
    Join Date
    07-02-2013
    Location
    Cheshire
    MS-Off Ver
    Office Professional 2007
    Posts
    79

    Re: VBA help needed

    Hi Rob (Is that the Rob Callaghan that used to work at BlueChip?)
    I think you could achieve what you want without a macro. Assuming your data starts in row 3, this formula in A3 and copied down would give the numbers you want.
    Please Login or Register  to view this content.
    John Mac

  3. #3
    Registered User
    Join Date
    03-29-2017
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    56

    Re: VBA help needed

    Hi John,

    Unfortunately no, i'm not the said Rob.

    Thanks for the suggestion but the formula wont work for this as i only want it to work where there is a blank cell (in a possible 1000+ rows), i need the rest of the data unaffected.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: VBA help needed

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  5. #5
    Registered User
    Join Date
    03-29-2017
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    56

    Re: VBA help needed

    Sorry, now edited.
    Last edited by rob.callaghan; 04-20-2020 at 11:44 AM.

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,445

    Re: run a sequence of numbers based on values found in 2 columns

    Thanks
    FYI also please do not quote entire posts unnecessarily. Use the " Quick reply" instead. Threads are then more easy to read

  7. #7
    Registered User
    Join Date
    03-29-2017
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    56

    Re: run a sequence of numbers based on values found in 2 columns

    I am not doing well am i

    all now understood - now can anybody help me out with this code, i've been searching all day for answers

  8. #8
    Registered User
    Join Date
    07-02-2013
    Location
    Cheshire
    MS-Off Ver
    Office Professional 2007
    Posts
    79

    Re: run a sequence of numbers based on values found in 2 columns

    Hi again Rob. Try this:
    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this demonstration !


    As a VBA beginner starter :

    PHP Code: 
    Sub Demo1()
                     
    Dim Rg As RangeL&
        
    With [E3].CurrentRegion.Columns
            
    If Application.CountBlank(.Item(3)) Then
                
    For Each Rg In .Item(3).SpecialCells(xlCellTypeBlanks)
                    
    = .Item(1).Find(Rg(1, -1), , , xlWhole, , xlPrevious).Row Rg.Row 1
                    Rg
    .Resize(L) = Evaluate("ROW(1:" ")")
                
    Next
            End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► ► So thanks to click on bottom left star icon « Add Reputation » ! ◄ ◄

  10. #10
    Registered User
    Join Date
    03-29-2017
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    56

    Re: run a sequence of numbers based on values found in 2 columns

    thank you both so much - both examples work perfectly

  11. #11
    Registered User
    Join Date
    04-20-2020
    Location
    Ottawa
    MS-Off Ver
    7.1
    Posts
    3

    Re: VBA help needed

    Are you Rob Callaghan that I worked with at Dalhousie University? Liked old sports cars?

+ 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: 2
    Last Post: 11-14-2019, 11:57 PM
  2. date formula help needed with blank cell and monthly assumtions formula needed
    By Michael.Howarth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2018, 07:47 AM
  3. [SOLVED] a function to copy the things needed from one sheet to another. only the ones needed
    By karim.zheng in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-31-2015, 09:49 AM
  4. Help needed: Do While Loop needed
    By xlislovexlislife in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2015, 11:00 AM
  5. Help needed
    By LiewDickson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-14-2013, 10:10 AM
  6. Complex Filter/Sorting Help Needed (VBA knowledge needed)
    By dfxryanjr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2013, 01:39 PM
  7. Conditional formatting needed for shape colour - is programming needed?
    By Farmboyuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2012, 07:27 AM

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