Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Deleting Rows In A Listview


How do I remove a number of selected items from a listview?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Deleting Multiple Rows From A Listview,vb6
hi All

I am doing an application in VB6 in which i have a ListView. I have four columns and some rows of data.
i have checked the option "Multi Select" and also "Checkboxes".

I have to select multiple rows by checking the check boxes and delete all the checked rows.
Can someone tell me how to delete multiple rows

Thanks in advance

Regards
Rajmv

Deleting Rows From ListView Object
Does anyone know how to delete rows from the ListView object? Is there a good place on the Internet where I can find information on this object's properties and methods?

Thanks...

Deleting Multiple Rows From A Listview,vb6
hi All

I am doing an application in VB6 in which i have a ListView. I have four columns and some rows of data.
i have checked the option "Multi Select" and also "Checkboxes".

I have to select multiple rows by checking the check boxes and delete all the checked rows.
Can someone tell me how to delete multiple rows

Thanks in advance

Regards
Rajmv

Lost In Listview...Deleting Multiple Rows
I have a Listview control that I am adding filenames as listitems via a Commondialog control. I have enabled multiselect whithin the Listview control. My problem lies with deleting multiselected rows. Every which way I attempt to do this ends in error. I am very new to the Listview control. Can anyone help?

Deleting Rows
Hey Group
I need a macro to look through Column A and delete each row where value is "FALSE". What am I doing wrong ?

Sub Macro1()
'
Dim X

For X = 1 To 345
If Worksheets("Summary").Cells(X, 1) = "False" Then
Worksheets("Summary").Rows(X).Delete
End If
Next

End Sub

------ or this

Sub Macro1()
'
Dim X

For X = 1 To 345
If Worksheets("Summary").Cells(X, 1) = "False" Then
Worksheets("Summary").Rows(X).Delete

Rows("X:X").Select
Selection.Delete Shift:=xlUp
End If
Next

End Sub

Deleting Rows??
I've writen an application that manifests data onto a sheet from an original sheet. My main goal here is to remove all the rows that have no value entered into column A. There will always be a different number of rows as well. What I've got so far, never deletes all the rows with an empty cell in column A. It also moves some of the values in column A into different rows. So you can see how worthless the code I wrote is.

Just for clarification, this is for my customers order guides. My application creates an order form with their prices and the items that they buy. However, they don't always want all of the items. Column A is my quantity column. So when a customer places an order, I type how many they want of specific items into column A. I then want to print this order, but only with the rows that I have entered a quantity in(column A).

I can print already, and all the other jazz is going great, I just can't get the rows with no column A value to delete correctly. Any direction here would be wonderful. Thanks in advance.

Deleting Rows
I am an advanced Excel User but a beginner at VBA.

This question is about deleting unneeded rows in a worksheet. I know how to set up a loop that would delete all the rows for which the date is say 6/30/2001 for example, but I want to delete all the dates that are not a year end date.

I have a worksheet called data which I copied from an ASCI file. This worksheet has many columns of data. One of the columns is for the date. The dates are in an unusual format. 312 is December 2003. 6 is June 2000. 106 is June 2001. 209 is September 2002. 9906 is June 1999. As you can see the date can be from 1 to 4 digits.

My idea is to use the right function. Basically I would say if Right("a1",2) <> 12 then delete, otherwise select the next cell. Am I on the right track or should I use another approach?

Deleting Rows: Need Help
Hey people I need help.

I need to delete rows that in column D8300 that has a value of 0 or are blank.

I can't figure it out I have search many sites. I can't find a sample. All I know in macro is recording. I know that this is simple so I hope that somebody helps me.

Deleting Rows From The Table
Dear all,

I want to import all rows from the spreadsheet into a table(in a SQL server database). I only import the rows where a 1 is in the first column. So when i have the following situation:

Code:
Col1 Col2 Col3 Col4
1 dfas dsfsd deer
34f sdffd deea
1 dfsd sdfs dffew
Here i only import the first and the last row. But at the moment i have a problem when these rows exists in the table, so i get dublicate records ( How can i delete the rows in the table and add them again(from the spreadsheet only the rows where there is 1 before). Col2 and Col3 are unique, so what i want to do is to delete the row dfas dsfsd and the row dfsd sdfs and then add this again....

Code:
For i = 1 To rng.Rows.Count
If Cells(i, 1) = 1 Then
lngCount = lngCount + 1
With rst
.AddNew
!field1 = Cells(i, 2)
!field2 = Cells(i, 3)
!field3 = Cells(i, 4)

.Update
End With
End If
Next
Hope that somebody could help me..

TIA..

Problem With Deleting Rows
What i'm trying to do is run through a bunch of rows and for each instance of the word "Mike", I want to delete that row. Problem is, I can't figure out which row i'm on. I know i'm only missing a line or two and some assistance would be greatly appreciated.

Sub testing()

For Each i In Worksheets("Sheet1").Range("A1:A10").Cells
If i.Value = "Mike" Then
' WHAT ROW AM I ON?????
' HOW DO I PASS IT SO I CAN DELETE IT?
ActiveCell.EntireRow.Delete
End If
Next


End Sub

YES! Deleting Duplicate Rows!!
By the few dozen searches I performed on this topic, I've come to the conclusion that this is a popular yet largely unsolved question. Now, I originally made a macro that did this effectively for a small chunk of data, but now I have about 30,000 rows of data.

The first macro I did simply concatenated four columns of data and compared it to every row in the worksheet. However, that was incredibly inefficient, so I'm trying to use the find & findNext commands. Problem is, I'm pretty unsure/unpolished on VB syntax, so if anyone out there gets the idea of what I'm trying to do and knows the syntax for it, I'd really appreciate it.

My code:


Code:
Sub Delete_Duplicates()

Dim currentRowCheck, LastRowInColumn, totalDeletes As Integer
totalDeletes = 0

ThisWorkbook.Sheets("Data").Activate
LastRowInColumn = Cells(Rows.Count, 1).End(xlUp).Row

totalDeletes = 0

For x = 1 To LastRowInColumn
Cells(x, "E").value = (Cells(x, "A").value & Cells(x, "B").value & Cells(x, "C").value & Cells(x, "D").value)
Next x
'concat all values to column "E"


For currentRowCheck = 1 To LastRowInColumn
findstring = Cells(currentRowCheck, "E").value
'set what we will be looking for
LastRowInColumn = Cells(Rows.Count, 1).End(xlUp).Row
Range("E1:E" & LastRowInColumn).Select
'Select column "E" for searching
Selection.Find(What:=findstring).Activate
Do
ActiveRow.Delete
'while the FindNext command returns true, activate and delete that row
totalDeletes = (totalDeletes + 1)
While Cells.FindNext(After:=ActiveCell).Activate Is Not Nothing
LastRowInColumn = Cells(Rows.Count, 1).End(xlUp).Row
Next currentRowCheck


ThisWorkbook.Sheets("Instructions").Activate
Cells(39, "F").value = totalDeletes

End Sub

Deleting Rows On A MSFlexgrid
If a cell in the last column of my flexgrid contains a 0, I want to delete that row and all of the rows before it. Here is my code to do that...

Code:
Private Sub Deletebt_Click()

Dim i As Integer
Dim x As Integer

With CompGrid
For i = 1 To .Rows - 1
If .TextMatrix(i, 4) = 0 Then
x = i
Exit For
End If
Next i
For i = 1 To x
.RemoveItem (i)
Next i
End With

End Sub
The problem is, if x = 5 then rows will delete until there is only 4 rows and then I get an error "Row 5 does not exist". Could someone show me how to change my code so that it will do what I am wanting it to do? Thanks

Deleting Duplicate Rows?
I have some Duplicate rows on my spreadsheet I need to get rid off all the duuplicaes but it will take for ever to look through the data.
any ideas guys?

Deleting Empty Rows
I know much was said about deleting empty rows. I have an excel workbook with two spreadsheets names LCA 01 and LCA 02 and these spreadsheets have a big gab of empty cells somewhere in the middle. For example between rows 56 and 499

I am interested in deleting anything that doesnt have an entry in the first column so I tried this little code

For i = Worksheets(1).UsedRange.End(xlDown).Row To 1 Step -1
'Is the cell at (row i, column 1) empty
If Cells(i, 1).Value = "" Then
Rows(i).Delete
End If
Next

but nothing seems to happen. I tried it on a blank workbook and it worked perfectly but on my renamed workbook it doesnt do a thing... Where did I go wrong?

Thanx
Helena

Deleting Rows (For Statement)
Hello all,

I'm having trouble with the formula below for some reason....I'm trying to delete the rows that don't qualify

When I put in the delete line below it doesn't work; however, when I put in the interior.colorindex to see what it is picking up - it highlights everything I want deleted.

Can anyone tell me what I'm missing??

Thanks!!



Code:
Public Sub cmdCalc_Click()

Dim a As Integer, b As Integer, c As Integer, d As Integer, e As Integer
Dim count As Integer, counter As Integer
Dim ah As String, bh As String, ch As String, dh As String, eh As String, h2h As String

ah = "A" & " " & "H"
bh = "B" & " " & "H"
ch = "C" & " " & "H"
dh = "D" & " " & "H"
eh = "E" & " " & "H"
h2h = "H" & "2" & "H"


Do

count = count + 1

Loop Until Worksheets("Payroll").Range("A" & count).Value = ""

count = count - 1

MsgBox count



For a = 2 To count

If Worksheets("Payroll").Range("D" & a).Value <> ah And Worksheets("Payroll").Range("D" & a).Value <> bh And _
Worksheets("Payroll").Range("D" & a).Value <> ch And Worksheets("Payroll").Range("D" & a).Value <> dh And _
Worksheets("Payroll").Range("D" & a).Value <> eh And Worksheets("Payroll").Range("D" & a).Value <> h2h Then

Worksheets("Payroll").Rows(a).Interior.ColorIndex = 46
'Worksheets("Payroll").Rows(a).Delete
End If

Next a

Deleting Duplicate Rows
A very banal, a hackneyed issue, what's the query to delete duplicate rows from a table. For instance if my table has three rows with exactly the same data, then how do I delete two rows and just let one of them remain?

Deleting Rows From The Table
I am trying to delete rows which are having the current date. For this I'm using the following query.

Dim Myconn as New ADODB.connection
Dim myrs as New ADODB.recordset
Dim mystr as string
dim sqdate as Date

Myconn.open str (where str is the path of the table in ms access)
sqdate=Date
mystr ="Delete From Products Where Prodate=" & sqdate
myrs.open mystr, Myconn,adopenkeyset,adlockoptimistic

I have tried this query but it doesn't delete the rows having the sqdate.

please help! Reply soon......

Deleting Rows In MSFlexGrid
How would you deleting an entire row in msflexgrid?

Deleting Duplicate Rows...
Hello there, I have a problem with duplicate records in SQL database. How can I choose duplicate records and delete them so, that one of the duplicated record left.
Thanx for any help...

Deleting Duplicate Rows
A very banal, a hackneyed issue, what's the query to delete duplicate rows from a table. For instance if my table has three rows with exactly the same data, then how do I delete two rows and just let one of them remain?

MSFlexGrid All Rows Deleting
Is there any command to delete all rows in an MSFlexgrid?

MSFlexgrid1.Clear, only clears data.
MSFlexgrid1.Removeitem index, deletes only a single row.

I'm looking for something like MSFlexgrid1.Remove ALL.

I want to set the grid on row 0 before adding new items.


Thanx
Ray

Deleting Rows Problem
Right any help appreciated.

I have a sheet which in 3 colums i have a vlookup which looks up comments from 3 sheets on a pas workbook and shows them.

These are for invoices. After doing the lookup with the 3 colums it leaves me with either a comment in there or if not n/a which all works fine.

What i am needing to do is only keep information that has n/a in each of the 3 colums on a row (ie its never had a comment for that perticular invoice in this case)

I did a macro where i went to goto sepecial etc and selected text after highlight the 3 colums as the range. Then this selected anything with a comment in the 3 colums and then i did edit rows delete - which left me with correct information,

This worked fine for a week and without doing any changes its now cumming up with an error saying "cannot use that command on overlapping sections" i don't understand why this has happended.

The code i am using for that particular bit is



Code:

Range("G2:I673").Select
ActiveWindow.ScrollRow = 1
Selection.SpecialCells(xlCellTypeFormulas, 2).Select
Selection.EntireRow.Delete



Thank you

Timeout When Deleting Rows
Hi,

My database has a table with 750000 rows, 75 columns, a record length of
approximately 1100 bytes and 20 indexes ...

One of the columns is a date.
When I try delete rows (one month per example) often I retrieve a
timeout error ... I already tried to change the timeout to 1200 but the
error continues ...

Somebody can help me ???

Thanks in advance
Abilio



------- Confidentiality Notice -------
This e-mail and related attachments may contain confidential and legallyprivileged information. If you are not the intended recipient or have reeived this e-mail in error, please delete it and notify by return email.If you are not the intended recipient you must not copy, adapt and forwad this email or any attachment or disclose its/their contents to any othr person.
Our own virus checking system has swept this e-mail and its attachments.However, we cannot guarantee that it is virus-free and cannot take resposibility for any virus, which may be present.

Problem With Deleting Rows
Hi

I am using vb 2005.
I have created few listboxes, in which i have listed items from diffrent tables and views.
Every listbox has it's own bindingnavigator with a NEW and DELETE buttons.
Everything seemed to be fine, bit when i got to deleting records from a view i get this error all the time:
"Update requires a valid DeleteCommand when passed DataRow collection with deleted rows"

I thought that i was doing something wrong, so i took an example function from this site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/smartclient_vb2005.asp

I have changed the syntax of the delete function so it shoul work ok... but i get the same error all the time.

when deleting records from a table, there is now error :/

Could somebody please help me with this one?





Edited by - krySTian on 7/6/2005 4:42:27 AM

Deleting Rows Following Some Rules
Hi, All.

What if I needed to eliminate rows following some rules, in order:

1 - They must contain duplicate keys between columns 1 and 9.

2 - In column 5, the key must be the "reverse" , instead of duplicated ( For example, -1 and 1, 3 and -3 , and so on .... like (((key1.value)(key2.value)) = 0)).

3 - In column 7, the keys should be compared and start the whole process only if the difference between the keys is greater or equal to 8 ... like Abs(key1 dd/mm/yy - key2 dd/mm/yy) >= 8. ( Date fields in the dd/mm/yy format - here in Brazil the day come before the month -


Sorry for my awfull english.

Thanks.

Deleting Rows That Contain An Erro (#N/A)
I currently have a dataset that contains lookups, and many of the lookups contain error #N/A, which is fine, but i want to know how i can filter out/delete all rows that contain #N/A in a cell in that row. I tried to use the basic autofilter in excel, but because of the quantity of data (around 2000 rows to be deleted), it basically freezes if i try to delete them all. I am thinking a string of code would be more effective...can anyone help?
Joel

 

Comparing And Deleting Rows
Hi Guys, its been a while since I handled excel macros and need a breif refresher, I need to compare the current cell to the cell in the next row, if they are the same, delete both rows(not just delete data but the entire row so the bottom data moves up), loop till end. Any suggestions will be highly appreciated as usual


so in essence I need to go from

A
A
B
C
E
E
F
G
G
H
I
I
J

to

B
C
F
H
J

So far im meddleing trying to remember proper syntax and this is what i got so far


Code:Dim x As Integer

For x = 1 To 1000 Step 1

y = x + 1

If (Worksheets("Sheet1").Range("A" & x) = Worksheets("Sheet1").Range("A" & y)) Then

Worksheets("Sheet1").Range(A & ":" & x).Delete
Worksheets("Sheet1").Range(A & ":" & y).Delete

End If
    
Next
    
End Sub

Which obviuosly doesnt work... but thats where you guys come in :-P

Thanks



Edited by - doctor on 4/7/2005 12:58:49 PM

Deleting Rows In A Word Table
I have a Word document that is created depending on the choices selected from a form: (the form uses bookmarks which inserts text dependant on which checkbox is selected.)

the resulting document consists of the Header
a table with choices made and the footer

if certain choices were not selected, then the table has blank cells
the resulting document of course has alot of blank lines (cannot see the cells of course unless gridlines are turned on

what I am looking for is a macro that will check for empty cells (in the second column)and if the cell is empty, delete the row.

(the table has 8 single column rows followed by 16 double column rows, followed again by 10 single column rows)
I want to run the macro on the double column rows

hope this makes sense

Deleting Duplicate Rows...VBA Code
I have found a bit of code that deletes duplicates and keeps rows based on the the highest value in column B.

BM411757 1
BM411757 2
BM411757 3

So the results of below code would be:

BM411757 3

however I am looking for something that would delete the row with the higest value. Result would be:

BM411757 1
BM411757 2

I haven't been able to adjust this code to work this out. Could someone help with this. Many thanks in advance.

Rob


Code:
Sub DeleteTheOldies()
Dim RowNdx As Long
For RowNdx = Range("A1").End(xlDown).Row To 2 Step -1
If Cells(RowNdx, "A").Value = Cells(RowNdx - 1, "A").Value Then
If Cells(RowNdx, "B").Value <= Cells(RowNdx - 1, "B").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub

Excel Macro For Deleting Rows
Hello!

I have to create an excel macro for following issue:
In Sheet(1) Colume A there are several values which are in Sheet 3
in Colume C. Now i need a macro which is searching each value in Sheet 1 in Sheet 3 and delete all those rows which have these values!



thanks!!

Speed Up Macros When Deleting Rows
Hi,

I have a workbook where a master sheet is copied several times and the new sheets are renamed. In each of them the AutoFilter is set to "does not contain" (e.g. <>**"Tom") and then the data shown is deleted. The deletion command takes very long (with the macro and also manually).

Is there any way I can speed that up? I have already tried setting Screen Update to false and Automatic Calculation to manual. It didn't do anything.

Edit:

Hi, I found a way to solve it, so more help is needed.

Disable Deleting Rows From Datagrid? Can It Be Done?
I have a datagrid which is bound to a disconnected recordset. I populate the recordset, then bind it to the datagrid. The user is able to modify cells in the datagrid, hwoever I want to prevent them from deleting rows (i.e. underlying records in my rs), can this be done?

what is happening is that if a user is in a cell and hits esc a couple of times, the row gets deleted. I don't want this to happen, but want the fields to remain editable.

Deleting Highlighted Flexgrid Rows
Howdy,

Anyone know how I can delete all Flexgrid rows that a user has highlighted? There is no problem in picking up the vbKeyDelete event and I've managed to code a delete function which deletes rows that match a certain criteria but its knowing which rows are highlighted that is giving me a headache.

Any help appreciated,
Scary

Deleting Rows In A Cyclic Pattern
I am quite new to Visual Basic, and am trying to make a macro that will cycle through a large set of data arranged in columns, and delete every 9 rows following the first row. For instance, if I have 90 rows, I will have 9 left, each spaced equally apart by nine rows. Any ideas would be appreciated.

Error Deleting Excel Rows Using VB
Here is the code:


Code:
Dim oConn As New ADODB.Connection
Dim oRS As New ADODB.Recordset

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & txtFileName & ";" & _
"Extended Properties=""Excel 8.0"""

oRS.Open "DELETE FROM [Sheet1$]", oConn, adOpenForwardOnly, adLockPessimistic
oConn.Close


VB returns this error message:

Run-time error '-2147467259 (80004005)':

Deleting data in a linked table is not supported by this ISAM.


This method works fine for inserting rows. Anyone can tell me how to resolve the problem?

Thank you so much!

Mike

Deleting Rows Of Data From A Txt File.
Hi all,
em iv a data file. basically rows and columns of data.

I need to delete a number of rows from the file starting at a certain position. For example, delete eveything from the start of the file to the 30th row.

any ideas?

Deleting Rows With Repeating Aguments.
First of all I need to show you what a code below used to be. I'm newbie, that's true. I tried to understand what means every word in the code. I began to read two tutorials, but still I cannot understand the entire code. Maybe you will put some light on that darkness in my mind. Well, I have found out a few things till now. But I shall introduce you how it is working and how it have to work. Before there were many (thousands) columns, but every two are splitted to each other. There are also breaks as two columns between aforsaid splitted columns. And this situation repeats again and again. As you will see in added sample from a link, some arguments (x) have repeating values (y) and I wanted to delete these middle arguments with repeating values leaving these rows with arguments (x), which are the lowest and the highest. Everything works good.

Here is a file with attached macro (attention: it's vb 6.0 = Excel, Office 2007):

http://rapidshare.com/files/73633040/File111.xlsm.html

or here is the code:

Code:
Sub test()
    Dim ws As Worksheet, a, i As Long, ii As Long, b(), n As Long, w(), e
    With CreateObject("Scripting.Dictionary")
        For Each ws In Worksheets
            With ws.UsedRange
    a = .Value
    .ClearContents
End With
            Redim b(1 To UBound(a, 1) * 2, 1 To UBound(a, 2))
            For ii = 2 To UBound(a, 2) Step 4
                For i = 1 To UBound(a, 1)
                    If Not IsEmpty(a(i, ii)) Then
                        If Not .exists(a(i, ii)) Then
                            .Add a(i, ii), Array(a(i, ii - 1), a(i, ii), a(i, ii - 1), a(i, ii))
                        Else
                            w = .Item(a(i, ii)): w(2) = a(i, ii - 1): w(3) = a(i, ii)
                            .Item(a(i, ii)) = w
                        End If
                    End If
                Next
                For Each e In .items
                    n = n + 2
                    b(n - 1, ii - 1) = e(0): b(n - 1, ii) = e(1): b(n, ii - 1) = e(2): b(n, ii) = e(3)
                Next
                n = 0: .RemoveAll
            Next
            ws. Range("a1").Resize(UBound(b, 1), UBound(b, 2)).Value = b
            n = 0
        Next
    End With
End Sub



As you will see the code above works perfect for such arguments with repeated values. It doubles every argument, where value isn't anywhere repeated, it leaves these arguments, where values repeat two times. It also overwrites these columns.

But the problem begins when I would like to use that program for repeating arguments (not values - every value is higher by 1 than one before). Quite similar situation but columns, which are splitted have exchanged their positions. Moreover there are one-column breaks. And yes, you are right - I want to delete these rows of coordinates, where arguments are repeating. And I would leave the highest and the lowest argument. I could do it manually for around twenty years. I think I just need a few changes in the code. One more thing - there are also titles above the columns (and letters x and y) - I would leave them.

Sample no. 2

http://rapidshare.com/files/73638127/File222.xlsx.html

If you know how to cure this code, please write your piece of code below. Also I would like to receive some explanation about my code - how every element works, and how it work with other things. I tried to understand those dimentions and operations (I spent over it my entire day with nothing meaning results). I hope you will help me.

Deleting Duplicate Rows In Excel
how do i delete duplicate data from a row?


john
john
john             john    
tom --------------->     tom
sam            sam
paul            paul
paul

Deleting Duplicate Rows In Excel
they are rows in excel.

For Each rw In Worksheets("report").Cells(1, 1).CurrentRegion.Rows
            this = rw.Cells(1, 1).value
            If InStr(this,last) > 0 then rw.Delete
            last = this
Next

this is what i have written but it doesn't get all duplicates.

0 john
1 john
2 john      john
3 tom =      tom
4 tom      paul
5 paul
6 paul
    

Conditional Deleting Of Rows In Excel
Hello!

I am VERY new to VB, and I am trying to write a macro that deletes all rows in a sheet where the value in columns G and H are both empty. I found the code below online, but I am having trouble editing it so that it works for what I need. Any suggestions?

Application.ScreenUpdating = False
  Application.Calculation = xlCalculationManual
  Dim cell As Range, rng As Range, i As Long
  Set rng = Columns("G")
  For i = rng.Count To 1 Step -1
     If rng(i).Value = "" _
          And rng(i).Offset(0, 1).Value = "" _
            Then rng(i).EntireRow.Delete
  Next i
  Application.Calculation = xlCalculationAutomatic
  Application.ScreenUpdating = True

Thank you so much!!

Deleting Rows From Multiple Tables
Hi out there,

I have a key field shared by more than one table. At some point I need to delete all rows from all the tables where this field is identical. How do I do that then in one nice quick SQL one liner?

Deleting Empty Rows In A FlexiGrid
Hi

Can somebody please help me with the code to delete empty rows in a FlexiGrid?

Thank you in advance.

Happy

How To Unselect Listview Row When I Click On White Area Of Listview Under Rows?
Hi all. could any one show me how i can detect if user clicked(left and write) on white area of listview as shown in the pic. When i say white area i mean area where there is no row in listview . I want to detect click on that white area and be able to unselect row and make frame invisable.

How To Unselect Listview Row When I Click On White Area Of Listview Under Rows?
Hi all. could any one show me how i can detect if user clicked(left and write) on white area of listview as shown in the pic. When i say white area i mean area where there is no row in listview . I want to detect click on that white area and be able to unselect row.

Deleting Seuential Rows In EXCEL -problem
Hi there, novice VB coder here...

I have a little headache I cannot find an answer to and that is deleting sequential line items (in a row) in an imported report.

Briefly, I am importing SAP generated reports into EXCEL and re-formatting. Problem is that the reports have fixed page breaks but a varied number of line items. Document can contain from 6 line items to over 200.

On importing I am currently using the following code to run down through the document to locate the page break lines (up to 6 lines for every 52 line items ) and attempt to delete them...


Quote:




Sub deleterows()

x = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row 'find last row with data



For i = 8 To x

' MsgBox i

Range("a" & i).Select

If Range("a" & i).Value = "" _
Or Range("a" & i).Value = "ZMLSCCR1" _
Or Range("a" & i).Value = "---------------------" _
Or Range("a" & i).Value = "Seq Mat #" Then
Range("a" & i).EntireRow.Delete
Else
ActiveCell.Offset(0, 0).Select
End If
Next i

End Sub




Problem is, as there may be up to 6 sequential lines in a row, it doesn't delete all the rows only every other row. It seems to get confused as to which line item it needs to delete.

The Offset statement was an attempt to stop the macro "hopping" rows...

All other fields in ("a" & i) contain an 8 digit numeric. (eg: 50132178)

I can't sort the document as there is a requirement to keep the excel line items in the same order as the original report.

Is there a way to stop it skipping or should I be approaching this differently?

Any help / direction will be greatly appreciated.

Regards, C.

Deleting Rows Containin Various Text Values
Greetings from New York. Searched this site but would not find an answer.

I would like VBA code which will search Column C, and delete all rows containing any of about 20 values (names or name-fragments). I don't want to have to type the values (names) each time.


Cheers, Steven

Deleting Rows From MsflexGrid Linked To Access DB
Hi Guys. Help please

How do i delete a highlighted row in the msflexgrid. I got the code to delete it from the msflexgrid but how do i link it to delete the row from the database.

Thanks
Shailen

Deleting Rows Bottom-Up ---- Range.End(xlUp)
I have tried to figure this out and it still starts from the Top-Down. Any idea?

Code:
Dim r As Range, s As Range, AddressEnd As Range

Set AddressEnd = ThisWorkbook.Sheets("CDSMarks").Range("E4")
Set r = AddressEnd.End(xlDown)

    With ThisWorkbook.Sheets("CDSMarks").Range(r, r.End(xlUp))
        For Each s In .Cells
            If Not (s = "USD") And Not IsEmpty(s) Then
                s.EntireRow.Delete
            End If
        Next s
    End With

Deleting Rows Based On Criteria For Multiple Columns
Hello,

In my spreadsheet I would like to delete all rows where columns D AND E are smaller than 0. Im kind of a newbie to excel VBA. I am able to delete a row based on a single criteria with this code

Code:
Sub DelErrors()
With Range("F1", [f65536].End(xlUp))
.AutoFilter Field:=1, Criteria1:="=#DIV/0!"
.Offset(1, 0).Resize(.Rows.Count - 1, 1).EntireRow.Delete
.AutoFilter
End With
End Sub
but i'm not able to delete rows based on a criteria for multiple columns. Im sure this isnt complicated but i wasnt able to find anything on the other threads. I have attached a sample of my file

Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved