-
WSalexanderd
AskWoody Loungersorry i seem to have duplicated the posting————————————————————————————————————————
-
WSalexanderd
AskWoody Loungerthe following code is used repatatively to place “yes” in a column in preperation for deleting the line . i would like to be able to increase the function so that i can make the macro run quicker.
—————————————————————————————————————————————————-wsh.Range(“P4”).FormulaR1C1 = _
“=IF(RC[-15]=33070,””yes””,IF(RC[-15]=33080,””yes””,IF(RC[-15]=33180,””yes””,IF(RC[-15]=33126,””yes””,IF(RC[-15]=33085,””yes””,IF(RC[-15]=33185,””yes””,IF(RC[-15]=33087,””yes””,””””)))))))”
wsh.Range(“P4”).Copy Destination:=wsh.Range(“P5:P6000”)
wsh.Range(“Q4”).FormulaR1C1 = _
“=IF(RC[-16]=33090,””yes””,IF(RC[-16]=33190,””yes””,IF(RC[-16]=33091,””yes””,IF(RC[-16]=33093,””yes””,IF(RC[-16]=33095,””yes””,IF(RC[-16]=33094,””yes””,IF(RC[-16]=33101,””yes””,””””)))))))”
wsh.Range(“Q4”).Copy Destination:=wsh.Range(“Q5:Q6000”)
wsh.Range(“R4”).FormulaR1C1 = _
“=IF(RC[-17]=33099,””yes””,IF(RC[-17]=33097,””yes””,IF(RC[-17]=33150,””yes””,IF(RC[-17]=33135,””yes””,IF(RC[-17]=33136,””yes””,IF(RC[-17]=33100,””yes””,IF(RC[-17]=33105,””yes””,””””)))))))”
wsh.Range(“R4”).Copy Destination:=wsh.Range(“R5:R6000”)
Application.CutCopyMode = False
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
Range(“A4”).Select
Selection.AutoFilter
Range(“A4:R6000”).Select
lastrow = ActiveSheet.UsedRange.Rows.Count
For r = lastrow To 1 Step -1
If LCase(Cells(r, 15).Value) = “yes” Then Rows®.Delete
If LCase(Cells(r, 16).Value) = “yes” Then Rows®.Delete
If LCase(Cells(r, 17).Value) = “yes” Then Rows®.Delete
If LCase(Cells(r, 18).Value) = “yes” Then Rows®.Delete
Next r -
WSalexanderd
AskWoody Loungersorry for the delay in replying but!!
I thank you all for your comments.it is some times hard to tell one’s peers what one has done without causing them to shake in their boots, but nothing lost, I will endeavour to give a further insite into the reason for and the subsequent programme.
I work in a sales office in which we also have control of the dispatch of all orders taken, the system is so flexible that as shelves are re-stocked with new goods the database is updated, and orders which have reached a certain value are released for packing and delivery.
The system is volatile in as much that the file can have 2400 lines as the attached file or some 7000 line as I have seen in the past 2 days.
I will list the way that I have tried to programme the macro. The file is transferred from a UNIX computer as a CSV file,
Which make it harder to work with?The manual working of removing all superfluous parts could take 3 hours with interruptions the macro takes approx 1.5 minutes.
1) Remove all accounts on stop——————————————– late payer
-
WSalexanderd
AskWoody Loungerhi john i agree with your comments about a book , infact i bought “excel 2000 vba published by wrox” what a wast of money for me , examples not working and the new staff cannot get them to work. can you suggest a good book to buy with lots of worked examples (that do work)
alexanderd
-
WSalexanderd
AskWoody Loungersorry for the delay but ntlworld server has been down and not only that i have brought the excel file but not the latest *.bas file home with me, i will try again tommorow.
-
WSalexanderd
AskWoody Loungerfurther to my request for help .
i have 3 sheets
1) barry 94
2) jim 22
3) ads1
the three sheets have identical programming except for the line
ActiveCell.FormulaR1C1 = _
“=IF(AND(RIGHT(RC[-8],5)=””TOTAL””,RC[-2]>650,RC[-2]650,RC[-2]<750),""YES"","""")"Range("I4").Select
Selection.copy
Range("I5:I1000").Select
ActiveSheet.Paste
Range("I4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Application.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
Calculate
Range("A3").Select
Selection.autofilter
Selection.autofilter Field:=9, Criteria1:="YES"
_'########################################################################
If i alter the programme as follows i get a better result which leads me to think i have a timeing problem. cn you help with a solution.
'#########################################################################
Range("A3").Select
Selection.autofilter
Selection.autofilter Field:=9, Criteria1:="YES"
Sheets("jim 22").Select
Range("A3").Select
Selection.autofilter
Selection.autofilter Field:=9, Criteria1:="YES"
Sheets("barry 94").Select
Range("A3").Select
Selection.autofilter
Selection.autofilter Field:=9, Criteria1:="YES"
alex -
WSalexanderd
AskWoody Loungerthank you for all your help
alex
-
WSalexanderd
AskWoody Loungereverthing worked fine except for one small point pls read the attached file
thanking you for all you have done so far
-
WSalexanderd
AskWoody Loungeriam sorry i havn’t replied sooner but my email server has been down.
i include a short xl file for you -
WSalexanderd
AskWoody Loungeri have three columns A B C
colum a holds “A” holds an account no.
colum b holds an invoiced ammount
i am sub totaling column B . if coolum B has ammounts varying between 10 and 1500 and i wish to subtotal i might get a subtotal of 1510.
in colum “C” i have to check and see if the value is between 1500 and 2000, and copy to a separate sheet. in this case the value of the subtotal is 1510 it could quite easily be 3500 but i would pick up the value of 1500 from colum “B” where as i only want the subtotals and not the individual values.A B C
12 1500 yes
12 10
12 485subtotal 1995 yes
-
WSalexanderd
AskWoody Loungeryes i agree, but whilst the sub total colum “D” would automatically be placed in the “D” colum. I want to place in colum “F” the resulting value
-
WSalexanderd
AskWoody Loungeryes and easy to use but try to get the subtotal in another colum than wehere microsoft want to put itsubtotal should be in column “F” i wish to place it in column “K”
-
WSalexanderd
AskWoody Loungerthank you for such a speedy reply. what i am trying to say is that each time the form is used the date is placed in cell “J12” automatically without keying in anything.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Awoke to a rebooted Mac (crashed?)
by
rebop2020
8 minutes ago -
Office 2021 Perpetual for Mac
by
rebop2020
1 hour, 20 minutes ago -
False error message from eMClient (Awaiting moderation)
by
WSSebastian42
1 hour, 52 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
4 hours, 52 minutes ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
5 hours, 14 minutes ago -
Outdated Laptop
by
jdamkeene
10 hours, 18 minutes ago -
Updating Keepass2Android
by
CBFPD-Chief115
15 hours, 43 minutes ago -
Another big Microsoft layoff
by
Charlie
15 hours, 23 minutes ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
6 hours, 20 minutes ago -
May 2025 updates are out
by
Susan Bradley
15 hours, 47 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
21 hours, 26 minutes ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
21 hours, 28 minutes ago -
Drivers suggested via Windows Update
by
Tex265
21 hours, 19 minutes ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
19 hours, 3 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
1 day, 4 hours ago -
Apple releases 18.5
by
Susan Bradley
22 hours, 44 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
1 day, 5 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
1 day, 6 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
13 hours, 38 minutes ago -
No HP software folders
by
fpefpe
1 day, 14 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
11 hours, 23 minutes ago -
Stay connected anywhere
by
Peter Deegan
1 day, 19 hours ago -
Copilot, under the table
by
Will Fastie
1 day, 10 hours ago -
The Windows experience
by
Will Fastie
2 days, 1 hour ago -
A tale of two operating systems
by
Susan Bradley
5 hours, 54 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
2 days, 7 hours ago -
Where’s the cache today?
by
Up2you2
2 days, 22 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
2 days, 15 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
1 day, 15 hours ago -
Blocking Search (on task bar) from going to web
by
HenryW
17 hours, 40 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.