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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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,224,813
Messages
6,181,107
Members
453,021
Latest member
Justyna P

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