![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 210
|
I have the following function..
=SUMIF(C:C,31,D:D)/COUNTIF(C:C,31) I need to call it from a macro and display results in a vb text box. TIA Jay |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Quote:
The following worked for me when placed in the userform initialize event -------------- Private Sub UserForm_Initialize() With ThisWorkbook.Sheets("Sheet1") UserForm1.TextBox1.Value = Evaluate("=SUMIF(C:C,31,D:D)/COUNTIF(C:C,31)") End With End Sub -------------- Modify to suit your workbook/sheets/range HTH, Jay |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|