Instruction Sheet to run macro

LLT

Board Regular
Joined
Nov 4, 2009
Messages
51
Hi Expert out there,

Need to seek your expertise. I have created a instruction sheet whereby I have a button which allows user to click on this button to run the macro for Estmt tab but it does not seem to work even if I put Sheets("Estmt") in the coding.

Thanks in advance for your help!

Sub Classification()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "C").End(xlUp).Row
For r = lr To 1 Step -1
' Classify - REPATRIATION
If Sheets("Estmt").Range("C" & r) Like "*REPAT*" Or Sheets("Estmt").Range("C" & r) Like "*SOUTH SHADY*" Then
Sheets("Estmt").Range("E" & r).Copy Destination:=Sheets("Estmt").Range("F" & r)
End If
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
What's the error you're receiving?

Have you tried splitting them up into two separate statements instead of using "Or" to join them together?
 
Upvote 0
Hi Glory,

Pls ignore my post as I have resolved it by puting the code in red. Thanks so much for yr response. :)

Have a gd week ahead!

Sub Classification()
Dim lr As Long, r As Long
lr = Sheets("Estmt").Cells(Rows.Count, "C").End(xlUp).Row
For r = lr To 1 Step -1
' Classify - REPATRIATION
If Sheets("Estmt").Range("C" & r) Like "*REPAT*" Or Sheets("Estmt").Range("C" & r) Like "*SOUTH SHADY*" Then
Sheets("Estmt").Range("E" & r).Copy Destination:=Sheets("Estmt").Range("F" & r)
End If
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top