VBA

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Use Title Blocks for Each Macro

http://exceluser.com/formulas/vbastds.htm
''=======================================================
'' Program: DoMemoData
'' Desc: Writes memo data to the memo sheet
'' Called by: PrintControl
'' Call: DoMemoData wbkReport, oStopRow
'' Arguments: wbkReport--Name of the report workbook
'' oStopRow--Number of the last row to process
'' Comments: (1) RunReport initializes the m_oMemoRowNum
'' variable
'' (2) wksMemo doesn't need to be static. And
'' it's over-defined. Fix this at some
'' point.
'' Changes----------------------------------------------
'' Date Programmer Change
'' 7/3/96 Charley Kyd Written
'' 8/28/97 Charley Kyd Re-set memo object. This is
'' needed at times in Excel 8
'' when the report workbook must
'' close then re-open.
''=======================================================

Use In-Line Comments
''If this routine was called by the batch routine...
If g_bCalledByBatch Then

''Get the reference of the changing date cell
sDateRef = GetNameVal("ChgDateCell", 0, g_nReference)

''If the date name is empty, return null sDateFormula
If sDateRef = g_sNull Then
sDateFormula = g_sNull

''Else, get the beginning formula in the date cell
Else
sDateFormula = m_wbkReport.Worksheets(1). _
Evaluate(sDateRef).Formula
End If
Else

Use Hungarian Notation Showing the Scope of a Variable Showing the Type of the Variable
Option Explicit
Dim m_wbkReport as Workbook
Option Explicit
Public g_wbkReport as Workbook

You might also like