+ Reply to Thread
Results 1 to 4 of 4

How to insert empty lines and code using a Macro

  1. #1
    Registered User
    Join Date
    06-25-2008
    Posts
    3

    How to insert empty lines and code using a Macro

    Hi everyone,

    I'm new to this forum, and actually also very new to Excel. I can do the basics, but lately I'm in need of a macro to make things a bit easier.

    I've tried to create it myself, without succes. Maybe some of you guys can help me out.

    what I need;

    I need a macro that can look up a value (0) within a certain column (column B). When it finds this value, it needs to add two empty rows above the active row, and needs to enter a text ("object X") in the second empty row, in the C column. This value X should represent the X'th found value (0) within column B.

    it should repeat this process until the end of my worksheet, (more than 30000 rows)

    what I need it for;

    The worksheet represents a 3d model, with XYZ coordinates of triangles. The triangles represent faces, but the faces should be split, instead of being one otbject of 30000 faces (see what I mean?)

    my own tryout;

    I tried a macro, with a find function and so on, but I actually don't really know what I'm doning. This was my attempt;

    Please Login or Register  to view this content.
    I will upload an example of my file, it allready includes 2 macro's that convert the data for different usage, but it will give you an idea of what I want. I have done a couple of lines (100) manually, but found out that this was simply way to timeconsuming... The excel can be found here; http://rapidshare.com/files/12489629...track.xls.html

    Can anyone help me with this?
    Last edited by Harmalarm; 06-25-2008 at 08:02 AM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Harmalarm

    Welcome to Exceltip forum

    Please take a couple of minutes and read the Forum Rules then edit your thread title by following the instructions in the rules (Rule 1) and wrap your VBA code (Rule 3)
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    06-25-2008
    Posts
    3
    That better? Well, I really hope anyone can help me with this...

  4. #4
    Registered User
    Join Date
    06-25-2008
    Posts
    3
    Ok, well I've taken this Macro from another thread, and it works, as far as the lineinserting is concerned. Only now I still need to insert the text ("object" X) in the forth column, everytime it inserts the two rows. I probably need to let a variable count upwards everytime it runs the loop, and let this variable be the output of X, but how do I do this? Any Idea?

    This is Code that I used;

    Please Login or Register  to view this content.

+ 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