PromptBase
Close icon
General
Home
Marketplace
Hire
Create
Login
Sell
Explore
🤖 GPT

Excel Macro Generater

Excel Macro Generater gpt prompt mini thumbnail
3Heart icon
Favorites
147Eye icon
Views
TestedTick icon
TipsTick icon
This prompt specializes in automating tasks ranging from basic data entry to complex calculations. You'll be guided through a structured process that involves defining your macro task, creating a logical sequence of steps, coding the macro in VBA, testing, debugging, and documenting the macro's functionality. This approach ensures that the macro accomplishes your intended task accurately and efficiently.
...more
$4.99
Get prompt
After purchasing, you will gain access to the prompt file which you can use with GPT or the app builder. You'll receive 20 free generation credits with this purchase. By purchasing this prompt, you agree to our terms of service.
Over 1 month ago

Prompt Details

Model
Chat - GPT-4 (gpt-4)
Token size
596 ($0.01790 / call)
Example input
I am looking to build a macro that checks all the numbers in a table, and if there are any prime numbers, multiply them together and give me the result
Example output
Here's the VBA code that implements the defined logic: Sub MultiplyPrimeNumbers() Dim rng As Range Dim cell As Range Dim product As Double Set rng = Range("A1:D12") product = 1 For Each cell In rng If IsNumeric(cell.Value) And cell.Value > 1 Then If IsPrime(cell.Value) Then product = product * cell.Value End If End If Next cell Range("E20").Value = product End Sub Function IsPrime(number As Double) As Boolean Dim i As Double For i = 2 To Sqr(number) If number Mod i = 0 Then IsPrime = False Exit Function End If Next i IsPrime = True End Function
Browse Marketplace