LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Delete row on another sheet same workbook problem

Hi all, i am using the code below and it is not working as i want it to,
could somebody please help me ??
When i want to run this i am in the sheet Recon and it counts the rows
in recon ??

Sub DeleteInvoice()
'
Dim i As Long, iLastRow As Long
Dim myInv As String
myInv = InputBox("PLease enter the number of the invoice to
delete...", "DELETE INVOICE", "024908")
With Sheets("Invoices")
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "A").Value = myInv Then
Rows(i).Delete
End If
Next i
End With
End Sub


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
 
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
Delete all but 1 sheet in workbook cdclayton Excel Programming 3 April 11th 06 10:47 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
Problem with shared workbook (history sheet) ACH Excel Worksheet Functions 2 December 9th 04 08:39 PM
Copy sheet from one workbook to another workbook problem Ron de Bruin Excel Programming 3 August 5th 04 07:19 PM
Excel VBA - VLookup problem referencing another sheet in the same workbook StylinEric Excel Programming 7 May 18th 04 01:21 PM


All times are GMT +1. The time now is 10:13 AM.

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

About Us

"It's about Microsoft Excel"