+ Reply to Thread
Results 1 to 1 of 1

Put data in default format

Hybrid View

  1. #1
    Registered User
    Join Date
    05-19-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    Unhappy Put data in default format

    Hey guys,

    could you please help me out?

    I have a set of data, typically set up like this:

    Cell A1: Product name
    Cell C1: Price
    Cell A2: Description

    Cell A3: Product name (#2)
    Cell C3: Price (#2)
    Cell A4: Description (#2)

    .. and so on.

    However, some products do not have a description.
    In that case, cell A2 (or A4, or A6...) is NOT a blank row but contains the name of the next product.

    What I want is to put everything in the above format.
    So if a product lacks a description, it should insert a blank row.

    The only thing I can think of is to look at column C.
    Typically, every second row in C should be empty.
    If the second row in C is not empty but contains a price, this means that a blank row should be inserted above (I guess).

    I hope this makes any sense, if not please reply, I will try to explain.

    Thanks in advance!
    --------

    ITS SOLVED:

    Sub fritz1234()
    For i = Range("a" & Rows.Count).End(xlUp).Row To 1 Step -1
    If Len(Cells(i, 3)) > 0 And Len(Cells(i + 1, 3)) > 0 Then Rows(i + 1).Insert
    Next
    End Sub
    Attached Files Attached Files
    Last edited by Fritz1234; 05-19-2011 at 08:22 AM. Reason: Solved

+ 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