VBA to enter and delete formula

aliaslamy2k

Active Member
Joined
Sep 15, 2009
Messages
416
Office Version
  1. 2019
Platform
  1. Windows
Dear Colleagues,

I need a VBA code to enter and delete below formula ( one by one ) in worksheet name " APP " in cell A2 ??

=(APPLC|'0F1X35'!UC)
=(APPLC|'0F1X35'!'UA')
=(APPLC|'0F1X35'!'MA')


many thanks in advance.

Kind regards,
AB:confused:
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Code:
With Sheets(" APP ")
  .Range("A2") = "=(APPLC|'0F1X35'!UC)"
  .Range("A2").ClearContents
  .Range("A2") = "=(APPLC|'0F1X35'!'UA')"
  .Range("A2").ClearContents
  .Range("A2") = "=(APPLC|'0F1X35'!'MA')"
  .Range("A2").ClearContents
End With
 
Upvote 0
Dear Ruddles

Thanks you very much :). Can you please tell me how to run this code ?
I am trying to assigning same to macro button, but its not working.
am I doing some thing wrong??:confused:


Private Sub CommandButton1_Click()
With Sheets(" APP ")
.Range("A2") = "=(APPLC|'0F1X35'!UC)"
.Range("A2").ClearContents
.Range("A2") = "=(APPLC|'0F1X35'!'UA')"
.Range("A2").ClearContents
.Range("A2") = "=(APPLC|'0F1X35'!'MA')"
.Range("A2").ClearContents
End With
End Sub


Error response :- Run time error '9'; Sub script out of range.


Kind regards,
AB
 
Last edited:
Upvote 0
Looks like VBA can't find a sheet called " APP ".

Double-check the name.
 
Upvote 0
Hi Ruddles,


I got it, actually i deleted the space between comma's ("APP")


Many thanks.
AB
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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