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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,886
Messages
6,175,190
Members
452,616
Latest member
intern444

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