Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 5
Exclamation delete part of a row based on certain criteria

i have a spreadsheet on jobs estimated. i have columns a to g to input data into. in columns h ai i have formulas for this data. i have formulas in 2000 rows (and i need this many rows). in column g, if the job has been closed, we put an "x" in that column. i would like to delete this row automatically without filtering and deleting it manualy. i only need to delete a to g in this row and leave h through ai (because these have formulas in them). can you please help me. i believe there is a way to use vba but i'm not really all that familar with it. please help somebody asap!!!!

thanks and GOD bless,

mark lane
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default delete part of a row based on certain criteria

Hi Mark,

please try this and see if this works

Sub PartDelete()
Range("G1").Select
For I = 1 To 2000
If ActiveCell.Value = "x" Then
ActiveCell.Offset(0, -6).Select
Range(Selection, Selection.End(xlToRight)).Clear
ActiveCell.Offset(0, 6).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Next I
End Sub
Try out this.


  #3   Report Post  
Junior Member
 
Posts: 5
Smile

Quote:
Originally Posted by Samuel
Hi Mark,

please try this and see if this works

Sub PartDelete()
Range("G1").Select
For I = 1 To 2000
If ActiveCell.Value = "x" Then
ActiveCell.Offset(0, -6).Select
Range(Selection, Selection.End(xlToRight)).Clear
ActiveCell.Offset(0, 6).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Next I
End Sub
Try out this.

thanks Samuel,

i will try this at work tomorrow. i appreciate your help. i have another question. how do i get this to run as soon as the worksheet is opened and keep running until it's closed? please help.

thanks and GOD bless,

Mark Lane

Last edited by mark lane : September 14th 06 at 01:15 AM
  #4   Report Post  
Junior Member
 
Posts: 5
Smile

Quote:
Originally Posted by mark lane
thanks Samuel,

i will try this at work tomorrow. i appreciate your help. i have another question. how do i get this to run as soon as the worksheet is opened and keep running until it's closed? please help.

thanks and GOD bless,

Mark Lane
thanks for the help
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suming selected cells based on two criteria Gerard Excel Worksheet Functions 3 August 9th 06 11:45 AM
sum items in a column based on criteria located in other columns Kurt Excel Discussion (Misc queries) 1 August 2nd 06 05:12 PM
Importing data from one worksheet to another based upon part numbe mizer Excel Discussion (Misc queries) 1 November 21st 05 07:46 AM
Returning Results Based on Two Criteria [email protected] Excel Worksheet Functions 7 October 23rd 05 02:53 PM
counting cells (COUNTIF) based on two or more criteria Tricia S. Excel Worksheet Functions 10 March 17th 05 02:17 PM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"