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: 31
Default VBA troubles

I have a code (see below)
i would like to be able to check in column D if there is already the same
document number,if the code find the same number it should delete the row and
paste the new values. This VBA is not working could someone help me?

Thanks

Sub Macro1()

Dim Wk As Workbook, Rep


Set Wk = Workbooks.Open(Filename:="C:\Databasere_validierun g.xls")



Windows("excel base.xls").Activate
Range("B1:B80").Select
Selection.Copy
Windows("Databasere_validierung.xls").Activate
Cells(Rows.Count, 1).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
If Application.CountIf([D:D], Cells(Rows.Count, 3).End(xlUp)) 1
Then
Var = Cells(Rows.Count, 3).End(xlUp)
For i = Cells(Rows.Count, 3).End(xlUp).Row - 1 To 1 Step -1
If Cells(i, 3) = Var Then Rows(i).Delete
Next i
End If
'Wk.Close True'
End Sub
 
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
SUMPRODUCT troubles Luke Excel Programming 9 December 2nd 09 12:36 AM
Troubles Jonas Krogh Excel Discussion (Misc queries) 1 October 22nd 09 11:14 AM
COM Add-in Troubles Howard Excel Discussion (Misc queries) 0 May 22nd 07 01:59 PM
IF troubles JG Excel Worksheet Functions 6 December 24th 06 04:58 AM
formula troubles deb Excel Programming 1 November 19th 03 02:12 PM


All times are GMT +1. The time now is 05:09 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"