+ Reply to Thread
Results 1 to 3 of 3

Sorting partial rows by equatation (see attachment)

  1. #1
    Registered User
    Join Date
    03-04-2015
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    3

    Question Sorting partial rows by equatation (see attachment)

    Hello,

    In the sample attached, I'm trying to move cells A-G, so the text in column G is equal to the one in H (value 1 for column I)
    As I only have basic knowledge about formulas and VBA, I've been searching around and tried some VBA-scripts but I can't seem to get it right.

    Does anyone has an idea how to do this?
    I have to get data sorted between two files, where one file is missing quite a lot of time-data (files consist data for weeks/months).
    So if I can't find a quick sorting-module or script, I'll be busy for some days I guess

    I'm sorry the explanation is a bit poor (English isn't my birth language), but I hope the sample gives you an idea of the problem.

    Many thanks in advance,
    Simon

    My input-language is Dutch, but I'll figure it out, if one comes with a solution in English
    Attached Files Attached Files
    Last edited by simonvdp; 03-04-2015 at 01:14 PM.

  2. #2
    Registered User
    Join Date
    03-04-2015
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    3

    Re: Sorting partial rows by equatation (see attachment)

    So summarized,
    The file has two columns where cells have the same value, only not in the same row.
    I'd like to move all columns (including one of these) to the row where these to columns have the same value, as the data is time-dependent and should stay with the right time.

    This means parts of the rows will have to be deleted (or moved to the bottom) to make this happen.
    Ideas?

  3. #3
    Registered User
    Join Date
    03-04-2015
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    3

    Re: Sorting partial rows by equatation (see attachment)

    One of my teachers helped me to find the solution, it may not be the perfect solution, but it works.
    For those interested:
    Sub VglData()


    Dim tijd As Date

    Range("e2").Select
    Selection.End(xlDown).Select
    rij1 = ActiveCell.Row
    i = 2

    Do While i <= rij1
    tijd = Cells(i, 5).Value
    uurmin = Hour(tijd) & ":" & Minute(tijd)
    tijd2 = Cells(i, 6).Value
    uurmin2 = Hour(tijd2) & ":" & Minute(tijd2)
    If uurmin <> uurmin2 Then
    bereik = "A" & CStr(i) & ":E" & CStr(i)
    Range(bereik).Delete Shift:=xlUp
    rij1 = rij1 - 1
    Else
    i = i + 1
    End If

    Loop

    End Sub

+ 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. help to delete rows 1 to 7 see attachment
    By RobinPrice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 09:39 AM
  2. need help sorting by partial text in a cell - I think! :)
    By SmithAngels in forum Excel General
    Replies: 16
    Last Post: 10-11-2013, 09:58 AM
  3. Duplicating partial rows.
    By Cyberpawz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2012, 01:50 PM
  4. Trouble sorting dates (with new attachment)
    By aca in forum Excel General
    Replies: 5
    Last Post: 12-18-2010, 05:28 PM
  5. Macro help?? highlight partial rows?
    By CABOS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2008, 06:00 PM

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