Help adding msg box to the code

Dayski147

Banned user
Joined
Apr 12, 2022
Messages
89
Office Version
  1. 2016
Platform
  1. Windows
I can't add msg box to the following code I don't know why as when adding it appears multiple times columns stage I want it to appear only once when process is finished

Sub dayski()
Dim r As Integer
Dim xnewr As Integer
For r = 5 To 650

Application.ScreenUpdating = False

If IsEmpty(Cells(r, 1)) Then Exit Sub
xnewr = Feuil5.Cells(1, 1).CurrentRegion.Rows.Count + 1
If Cells(r, 1).Value = "" Then Exit Sub

Feuil5.Cells(xnewr, 1) = Cells(r, 1)
Feuil5.Cells(xnewr, 2) = Cells(r, 2)
Feuil5.Cells(xnewr, 3) = Cells(r, 3)
Feuil5.Cells(xnewr, 4) = Cells(r, 4)
Feuil5.Cells(xnewr, 5) = Cells(r, 5)
Feuil5.Cells(xnewr, 6) = Cells(r, 6)
Feuil5.Cells(xnewr, 7) = Cells(r, 7)
Feuil5.Cells(xnewr, 8) = Cells(r, 8)
Feuil5.Cells(xnewr, 9) = Cells(r, 9)
Feuil5.Cells(xnewr, 10) = Cells(r, 10)
Feuil5.Cells(xnewr, 11) = Cells(r, 11)
Feuil5.Cells(xnewr, 12) = Cells(r, 12)
Feuil5.Cells(xnewr, 13) = Cells(r, 13)
Feuil5.Cells(xnewr, 14) = Cells(r, 14)
Feuil5.Cells(xnewr, 15) = Cells(r, 15)
Feuil5.Cells(xnewr, 16) = Cells(r, 16)
Feuil5.Cells(xnewr, 17) = Cells(r, 17)
Feuil5.Cells(xnewr, 18) = Cells(r, 18)
Feuil5.Cells(xnewr, 19) = Cells(r, 19)
Feuil5.Cells(xnewr, 20) = Cells(r, 20)
Feuil5.Cells(xnewr, 21) = Cells(r, 21)
Feuil5.Cells(xnewr, 22) = Cells(r, 22)
Feuil5.Cells(xnewr, 23) = Cells(r, 23)
Feuil5.Cells(xnewr, 24) = Cells(r, 24)
Feuil5.Cells(xnewr, 25) = Cells(r, 25)
Feuil5.Cells(xnewr, 26) = Cells(r, 26)
Feuil5.Cells(xnewr, 27) = Cells(r, 27)
Feuil5.Cells(xnewr, 28) = Cells(r, 28)

Cells(r, 5) = ""
Cells(r, 6) = ""
Cells(r, 7) = ""
Cells(r, 8) = ""
Cells(r, 9) = ""
Cells(r, 10) = ""
Cells(r, 11) = ""
Cells(r, 12) = ""
Cells(r, 13) = ""
Cells(r, 14) = ""
Cells(r, 15) = ""
Cells(r, 16) = ""
Cells(r, 17) = ""
Cells(r, 18) = ""
Cells(r, 19) = ""
Cells(r, 20) = ""
Cells(r, 21) = ""
Cells(r, 22) = ""
Cells(r, 23) = ""
Cells(r, 24) = ""
Cells(r, 25) = ""
Cells(r, 26) = ""
Cells(r, 27) = ""
Cells(r, 28) = ""
Application.ScreenUpdating = True


Next


End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
VBA Code:
Application.ScreenUpdating = True
Next r
MsgBox "Process Completed"
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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