Mcro is not working

Hi ALL,

while i am trying to delete columns in .xlsm by using macro code but getting this error

excel

i want to delete these unwanted columns

Thank you

Hello @vineelag
You can use the Clear range activity in Excel application Scope- Modern
image

If You are a classic user, Follow this to enable Modern Activities
Activity pannel> Click Filter> Select the Show modern, then search the Modern Excel activities.
image

@Gokul_Jayakumar, Thank you

but i am not allowed to use modern.

@vineelag

Please try this

Sub delete()

Activesheet.Columns("G:R").Delete

End sub

Cheers