![]() |
|
#1
|
|||
|
|||
![]() Thank you pecoflyer. How would I write it if I also want to delete rows where the value of column D is 0? |
#2
|
||||
|
||||
![]()
I'd never used that particular value of SpecialCells; sounds like just the ticket.
Joflow, the number of incoming worksheets may change every time; but since the program is doing the importing, surely it can count them as it happens? But if the headers are all the same, this should work too: Code:
Set so = TheSubjectWorksheet jr = 1 val1 = so.Cells(jr, 1).Value 'column header for col A Do jr = jr + 1 Loop While so.Cells(jr, 1).Value = val1 Range(so.Cells(2, 1), so.Cells(jr - 1, 1).EntireRow.Delete |
#3
|
|||
|
|||
![]()
Thank you Bob. I did wind up using a different code since the value in column A would be the same in all of the headers. I just used:
Sub DeleteRepeatedHeader() Dim LR As Long, i As Long LR = Range("A" & Rows.Count).End(xlUp).Row For i = LR To 2 Step -1 If Range("A" & i).Value = "PLANID" Then Rows(i).Delete Next i End Sub |
#4
|
||||
|
||||
![]() Quote:
Again, I'm no VBA man, but as far as I know the fastest way is to use the auto filter from within a macro. There are examples around.
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#5
|
|||
|
|||
![]()
Thank you.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
flackend | Mail Merge | 4 | 12-01-2023 02:49 PM |
![]() |
dennist77 | Word | 1 | 10-29-2013 11:39 PM |
Print attachment when it arrive in specific folder with specific subject | visha_1984 | Outlook | 1 | 01-30-2013 10:42 AM |
![]() |
Hoochtheseal | Word VBA | 1 | 01-29-2013 09:23 PM |
Adding columns in specific rows only | mhays | Excel | 5 | 01-17-2012 09:13 AM |