Macro not working anymore

aubreelee

New Member
Joined
Jan 9, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon,

I hope someone will be able to help me with following situation

Im working on a file with a lot of data. The macro used was working perfectly until recently. Im not the one who created it and I don"t have many knowledge on Macros...
The goal is to have the price in column S divided per 100 and to have the unit per 1 (instead of 100) in column U. (ref. screenshot)> This is the macro :

Sub FindandReplace()
'Price per unit

last_row = Sheets("SAPSource").Cells(63500, 15).End(xlUp).Row
Range("U2:U" & last_row).Select
Selection.Copy
Range("S2:S" & last_row).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlDivide, _
SkipBlanks:=False, Transpose:=False
Sheets("SAPSource").Cells(2, 21).Value = 1
Sheets("SAPSource").Cells(2, 21).Select
Selection.Copy
Range("U2:U" & last_row).Select
Selection.PasteSpecial Paste:=xlPasteValues, SkipBlanks:=False, Transpose:=False


Do you have an idea of what's the problem here?

Thank you so much for your help
 

Attachments

  • Capture.PNG
    Capture.PNG
    102.7 KB · Views: 7

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Thank you for your reply. this is the error message I have when I hit the update button
 

Attachments

  • Capture.PNG
    Capture.PNG
    27.2 KB · Views: 12
Upvote 0
I am not sure about error you got - never seen anything like that myself
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,853
Messages
6,175,013
Members
452,600
Latest member
nicoCrous75

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