Closed Thread
Results 1 to 4 of 4

adding space in between rows

Hybrid View

  1. #1
    Registered User
    Join Date
    12-28-2007
    Posts
    2

    adding space in between rows

    I have alot of data in one column, it is temperature readings taking every 3 minutes for about a month, and then every 10 minutes thereafter. I am trying to put space in between the data so that I can group them by hour. Right now I am going through after every hour, and going to *Insert* --> Row ... adding 3 new rows to space out my data. Is there an easier way to add space? It is taking forever to do it manually.

    Thanks

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try this macro

    Press Alt + F11 and select insert Module and paste in the below.
    Close VB and then press Alt + F8 and select InsertRows from list and run


    Sub InsertRows()
    Dim Lr As Long, i As Long
    Lr = Cells(Rows.Count, "A").End(xlUp).Row
    For i = Lr To 2 Step -1
    Range(Cells(i, "A"), Cells(i + 2, "IV")).Insert Shift:=xlDown
    Next i
    End Sub
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-28-2007
    Posts
    2
    hey thanks for answering. Your macro worked, but its not spacing in the right place. Like for my temperature measurments every 3 minutes, there are 20 values, then I want to put in like 3 rows space... So it would be 20 values... 3 spaces... 20 values ... 3 spaces, etc... so it groups it by hour
    And then for temperature values every 10 minutes, it would have to be 6 values, then 3 spaces, 6 values , then 3 spaces after the 6th value, etc.....

    I don't know if that is possible?? Its hard because I have a whole bunch if different data sets, so its hard to set it up the spacing correctly for everyone. Is there anyway I can change the macro myself? For the readings every 3 minutes it would have to be 20, then a space because grouping them by 20 would gives me an hour. ANd for 10 minutes, grouping them every 6 would give me an hour aswell. Hopefully you can help, it takes too long doing it manually

    thanks for the help

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

Closed 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