+ Reply to Thread
Results 1 to 13 of 13

VBA Script to add and remove rows

Hybrid View

Skorpionkz VBA Script to add and remove... 03-12-2013, 11:20 AM
patel45 Re: VBA Sript to add and... 03-12-2013, 12:08 PM
Skorpionkz Re: VBA Sript to add and... 03-12-2013, 12:27 PM
arlu1201 Re: VBA Sript to add and... 03-14-2013, 08:20 AM
Skorpionkz Re: VBA Sript to add and... 03-15-2013, 09:03 AM
arlu1201 Re: VBA Sript to add and... 03-15-2013, 09:21 AM
Skorpionkz Re: VBA Sript to add and... 03-15-2013, 10:25 AM
Skorpionkz Re: VBA Sript to add and... 03-19-2013, 06:51 AM
patel45 Re: VBA Sript to add and... 03-19-2013, 08:24 AM
Skorpionkz Re: VBA Sript to add and... 03-19-2013, 10:59 AM
AB33 Re: VBA Script to add and... 03-19-2013, 11:06 AM
Skorpionkz Re: VBA Script to add and... 03-19-2013, 11:26 AM
Skorpionkz Re: VBA Script to add and... 03-20-2013, 10:34 AM
  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    VBA Script to add and remove rows

    Hi guys,

    I updated information for script I need:

    I have 2 Sheets: Conditions, DDL

    Script 1 Should check if in Condition Sheet cell value B15 is Yes or No.

    If "No" Script Should check if range A27:A50 contains (not equal) CALBridge or CALBrdg and if yes delete each row which has it.

    If "Yes" do nothing.

    Script 2.
    1. In Sheet DDL, Script should check how many cells have value "Ok" in range "I8:I31"
    2. In Sheet Conditions, Script should insert variable number of rows depending on how many "Ok" it found in point 1
    3. Sheet DDL, in range A8:I31 for all "Ok" in column "I" copy appropriate Cells A:B and paste to Conditions Sheet in inserted raws
    4. There is drop down menu in Sheet DDL, it takes value from Sheet DDL range A4:B4, when I copy this to another sheet drop down menu does not follow same conditon, so script should update dropdown menu to collect information from Sheet DDL range A4:B4 and by default select No from this menu
    Both scripts I will associate with buttons.

    I hope this make more sense than initial script I asked for.

    Thank you
    Attached Files Attached Files
    Last edited by Skorpionkz; 03-20-2013 at 11:03 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA Sript to add and remove rows

    attach a sample file with comments
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Sript to add and remove rows

    Correct attachment is in post 1.

    I cannot remove this one. Can some admin remove this attachment or this post?
    Attached Files Attached Files
    Last edited by Skorpionkz; 03-20-2013 at 10:43 AM.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Sript to add and remove rows

    Admin note: I have merged your new thread with this thread. If you need to move a thread to the top of the list or to page 1, you have to add a new post to the same thread - this will move your thread up (its called bumping) to the top. Please do not create duplicate threads for the same question.

    Since i have replied to this thread, it has already been bumped, so you do not need to do it again.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  5. #5
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Sript to add and remove rows

    Bumping my tread

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Sript to add and remove rows

    Can you please explain the 2nd part -
    Second script should use Value from cells D34:36 in Sheet DDL as Condition for Pivot (cells B34:B36) and copy result (copy all non blank rows 38:62) of Pivot to Condition Sheet starting with raw 25.
    Its not clear. There is no data in D34:D36 in sheet DDL.

  7. #7
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Sript to add and remove rows

    I'm sorry when I deleted another information it all moved up
    It should be like that now:
    Second script should use Value from cells D28:30 in Sheet DDL as Condition for Pivot (cells B28:B30) and copy result (copy all non blank rows 33:56) of Pivot to Condition Sheet starting with raw 25.
    I'm sorry for confusion

  8. #8
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Sript to add and remove rows

    Question to skilled guys. Does my request is so complex that no one giving solution?

    I have prepared my Spreadsheet with Pivot. Now it is not 100% what I want to have. That why I am asking for this script, but if this is too complex I will stay with what I have.
    Please just let me know if there is a point to wait on it?
    Last edited by Skorpionkz; 03-19-2013 at 06:55 AM.

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA Sript to add and remove rows

    Quote Originally Posted by Skorpionkz View Post
    Question to skilled guys. Does my request is so complex that no one giving solution?
    I don't know, I asked for a sample, you attached an empty file...

  10. #10
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Sript to add and remove rows

    Did't realise it is empty. It's working on my computer. Re-uploaded.
    Attached Files Attached Files
    Last edited by Skorpionkz; 03-19-2013 at 11:01 AM.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Script to add and remove rows

    Script Should check if in Condition Sheet cell value B15 is Yes or No.

    If "No" Script Should check if range A25:A48 contains (not equal) CALBridge or CALBrdg and if yes delete each row which has it.

    The last data you have is in Range 23, so I do not know where you are getting your data from.

  12. #12
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Script to add and remove rows

    There is second part of request which adding data. So if we will start macro again this range (A25:A48) might have data

    Second script should use Value from cells D34:36 in Sheet DDL as Condition for Pivot (cells B34:B36) and copy result (copy all non blank rows 38:62) of Pivot to Condition Sheet starting with row 25.
    little clarification: Macro should actually not copy rows from result of Pivot, this should insert rows to Conditions Sheet
    Last edited by Skorpionkz; 03-19-2013 at 11:30 AM.

  13. #13
    Registered User
    Join Date
    03-05-2013
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: VBA Script to add and remove rows

    I updated information about script i need.
    Please check out in first post.
    Last edited by Skorpionkz; 03-20-2013 at 10:56 AM.

+ 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