Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2017, 06:35 AM
BobbyG BobbyG is offline VBA - Deleting Rows (criteria based) Windows 7 32bit VBA - Deleting Rows (criteria based) Office 2010 32bit
Novice
VBA - Deleting Rows (criteria based)
 
Join Date: Mar 2015
Location: York - UK
Posts: 3
BobbyG is on a distinguished road
Default VBA - Deleting Rows (criteria based)

Hi all, I'm looking for some help using VBA to delete rows in an MSP I own.



There are tasks in my plan labelled as either "C" or "I" (as in Client or Internal) using a custom "text23" column. I'm currently having to manually delete, line by line those labelled "I" in order to send my client a sanitised version of the plan.

I'm not quite at the stage yet to write my own VBA, but I'm certainly able to administer it. does anyone have an idea as to how the code to perform this task should look?
Reply With Quote
  #2  
Old 07-31-2017, 08:55 AM
silentwolf silentwolf is offline VBA - Deleting Rows (criteria based) Windows 7 64bit VBA - Deleting Rows (criteria based) Office 2010 64bit
Novice
 
Join Date: Dec 2016
Location: Austria
Posts: 16
silentwolf is on a distinguished road
Default

Hi,

Code:
Sub DeleteMsProjectTaskNeu()
    Dim proj As Project
    Dim t As Task
    Set proj = ActiveProject

        For Each t In proj.Tasks
            If t.Text1 = "I" Then
                t.Delete
            End If
        Next t

End Sub
I just tested this code and it works for me but I am not that good in ms project VBA so I hope this works for you too!

Make sure you save your project before testing!!
And maybe someone other has a look at this code too .-)

HTH

SW
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA - Deleting Rows (criteria based) Deleting rows based on the text in certain cells VBA ThisGuyJohn Excel Programming 5 02-03-2017 03:16 PM
VBA - Deleting Rows (criteria based) Sum based on multiple criteria (one of the criteria is not unique) until a threshold is reached. phillipsdp Excel 1 11-09-2016 12:53 AM
Copying rows through to another worksheet using criteria and VBA alisun125 Excel Programming 1 06-01-2016 03:05 AM
VBA - Deleting Rows (criteria based) Excel VBA Macro - Deleting Specific Data based on criteria MD011 Excel Programming 3 12-10-2014 02:15 AM
VBA - Deleting Rows (criteria based) Deleting rows with specific criteria joflow21 Excel 9 11-22-2013 12:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:20 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft