+ Reply to Thread
Results 1 to 3 of 3

problem running delete row macro

  1. #1
    Registered User
    Join Date
    02-21-2005
    Posts
    2

    problem running delete row macro

    Hello all,

    I have a spreadsheet that needs formatting. Each row contains bio info and two sets of addresses. I want these to be broken out into three rows so that bio is on the first row followed by a row for each address. I got this to work fine by running the following macro. I ran it twice(once for each address):

    Please Login or Register  to view this content.
    Then i tried to ran a variety of delete macros, none of which deleted any of the blank rows that were inserted by the macro above. I think this is because the above macro is not really inserting blank rows but parts of rows(my best dummy guess). I dont know much about macros(since i had to take examples i found and run those) so i dont know how locate the problem exactly. Here is one of the macros that is supposed to delete rows but doesnt.

    Please Login or Register  to view this content.
    Now this macro delete rows just fine, but it wont delete any of the rows created by the first macro. Can anyone help me out here? Thanks

    Andy

  2. #2
    Registered User
    Join Date
    02-21-2005
    Posts
    4

    RE: problem running delete row macro

    I use this to delete rows from my excel sheets say in column T.
    Substitute nameofsheet with your worksheet name and criteria with whatever it is that decides a row should be deleted and of course change the range to suit your needs.




    Dim t As Range
    Application.ScreenUpdating = False
    Do: Set t = Worksheets("nameofsheet").[T:T].Find("criteria", LookIN:=xlValues, lookAt:=xlPart)
    If Not t Is Nothing Then t.EntireRow.Delete Else Exit Do
    Loop
    Application.ScreenUpdating = True

  3. #3
    Registered User
    Join Date
    02-21-2005
    Posts
    2
    I think i have found a way around this problem since none of the delete row macros work, including the one you offered. Is it possible to change the floowing code around so that it would only run if column 12 is NOT blank? If it is blank i wouldnt want the function to work on that row since it would just be adding a blank row in.

    Please Login or Register  to view this content.

    Thanks

    Andy

+ 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