Prevent formulas from recalculating on cell value deletion

gumberino

New Member
Joined
Jun 28, 2021
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
I am working on a project for work that involves HTTP requests. After struggling through getting that to work, my next problem is trying to prevent the VBA function from recalculating when one of the argument cells is cleared. Below is my attempt at a solution thus far:

VBA Code:
Function HTTPGet(ISO As String, HE As Single, Node As String, Bid As Single, MW As Single)
    Dim sCmd As String
    Dim sResult As String
    Dim lExitCode As Long
    Dim Counter As Integer
    Dim MyArray() As String
    If IsEmpty(HE) = True Or IsEmpty(Node) = True Or IsEmpty(Bid) = True Or IsEmpty(MW) = True Then
        Exit Function
    End If
    sCmd = "curl --get http://localhost:8000/" & ISO & "/" & HE & "/" & Node & "/" & Bid & "/" & MW
    sResult = execShell(sCmd, lExitCode)
    
    
    
    HTTPGet = sResult
    
End Function

My attempt at bypassing this was the implementation of the IF statement after the variable types are all declared.

The problem I am having as stated, is that when one of the cells is cleared, it recalculates the function. Often times, I will need to clear 500 rows and apart from taking a long time, it is unnecessary HTTP GET requests to the server, which upon implementation, will no longer be on localhost.

Any help here is appreciated.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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