PDA

View Full Version : Macro wont run on duplicate columns



ella1327
08-28-2020, 11:55 PM
Hi everyone,

I need some help with my macro. Currently, it is only picking up on the criteria in the first 3 columns. I need it to run on my entire worksheet without having to reformat and put all of my data under the first three columns. I want to be able to keep the format as is but still have the macro pick up on the criteria in all the columns. Is this possible to do? I'm new to the macro world so please let me know if something is unclear. Thank you in advance for your help!

Gabriella

Here is the code I'm using:

Sub Test()
'
' Test Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Sheets("Operations").Range("A4:N34").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Operations").Range("V4:V6"), CopyToRange:=Range( _
"A1:B1"), Unique:=False
End Sub

Bob Phillips
08-29-2020, 02:14 AM
I think it is all a bit unclear Gabriella. You say columns, but the criteria are in rows.

Can you post the workbook to help us understand?

ella1327
08-31-2020, 12:02 AM
Hi Bob, Thank you so much for your response. The first picture shows three sections of the workbook (Friday, Saturday and Sunday are the headers). Underneath those headers, you'll see three columns that say employee name, self cert received and notes. I want the macro to be able to pick up on self-certs that are labeled as "late" or "no". If you look at the second picture, you'll see the macro is only picking up on changes made to the first three columns under Friday (Polly is listed as late) and it's not picking up the data under Saturday and Sunday (Edward and Zack are not listed even though they should be) . Does this clarify the issue I'm having?