Home > Software engineering >  Excel vba scripts
Excel vba scripts

Time:03-09

Function of Excel, module function, how to using the return value in a worksheet or workbook? Sheet1 boc number does not perform, want to write in the module, and then call

CodePudding user response:

Sub Macro1 ()
Sheet1. Range (" A3 ")=add (Sheet1. Range (" A1 "))
End Sub

The Function additive (a) As Long As Long
Add=a + 1
End the Function

CodePudding user response:

The
reference 1/f, don't understand, don't say ah response:
Sub Macro1 ()
Sheet1. Range (" A3 ")=add (Sheet1. Range (" A1 "))
End Sub

The Function additive (a) As Long As Long
Add=a + 1
End the Function

I'm in Excel by inserting some conbobox, fixed writing some options, the function in the module have the if the else judgment, for different conditions have different return values, how to use the function will be called in sheet1 add value? Eventually want to put the function return value displayed in the Excel spreadsheet, can be directly copied, don't want to link, if it doesn't matter if modified by mistake in the table, choose will refresh again
  •  Tags:  
  • VBA
  • Related