WasteNot Excel VBA Library Module LM1
Foundation Library Module Documentation
FouC > OS > Clipboard >
GetCbUText
GetCbUText (
oStr As String )
As Boolean
'181219a
If Successful, returns the Unicode Text component of the Clipboard Contents
as oStr
as oStr
FouC > OS > Clipboard >
we_cbFn
CBFns() Clipboard Functions
Enumeration
`181228e Fouc.CbFns()
we_cbClear
we_cbPut
we_cbGet
we_cbGetT
we_cbGetR
we_cbGetRT
same as Application.CutCopyMode = False
Unicode Text (uText) Or Range
uText
Range
Range uText And Range
we_cbPut
we_cbGet
we_cbGetT
we_cbGetR
we_cbGetRT
same as Application.CutCopyMode = False
Unicode Text (uText) Or Range
uText
Range
Range uText And Range
FouC > OS > Clipboard >
CbFns
CbFns (
iFn As we_cbFn,
Optional iocStr As String, _
we_cbFn's cannot be Combined in iFn
Clear & Put always Succeed (including Putting the Null String)
Get Functions can return
1) Clipboard Unicode Text Data (iocStr)
and/or
2) the Type (ocRaT) and Source (ocSRa) of
Copied** Clipboard Range Data
For Type2,
- **NOTE that CbFns Fails if the Clipboard Data was Cut, rather
the Copied, to the Clipboard (whereas it Succeeds for Type 1)
- ocRaT returns ocSRa's Range Type, as per we_RaT
- ocSRa returns the Source Range of the Clipboard Data
GetFn Succeeds for ocRaT Rel. to Sets
Cb Data Type(s) we_raNothing Output(s)
-------------+------------------+----------------+--------------------+
we_cbGet uText Or Range >= iocStr Or ocSRa
we_cbGetT uText = iocStr
we_cbGetR Range > ocSRa
we_cbGetRT Range > iocStr & ocSRa
Note that the Getting the Null String, or a Blank Range, will Succeed
BEWARE: 1) Get Functions Use, and then Delete, the Last Row and Column
of the Activesheet. The UsedRange is NOT changed (unless
the Last Row or Column originally contained Data)
2) All Get Functions, except we_cbGetR, MAY cause Excel to Crash
if there is a VERY large amount of Text Data (100's of Mbs)
in the Clipboard (eg calling we_cbGetRT after copying an
Entire Worksheet)
See CodeNotes > Excel Ranges & the Clipboard; Note that it is possible to
"mimic" a Range.Copy using Put, but Getting this string returns Type1,
and will Paste as Unformatted Text
Optional ocRaT As we_RaT,
Optional ocSRa As Range, _
Optional ocNRs As Long, Optional ocNCs As Long ) As Boolean '181228a
Clears, or Puts/Gets iocStr Into/From, the Clipboard
(see we_cbFn) Optional ocNRs As Long, Optional ocNCs As Long ) As Boolean '181228a
we_cbFn's cannot be Combined in iFn
Clear & Put always Succeed (including Putting the Null String)
Get Functions can return
1) Clipboard Unicode Text Data (iocStr)
and/or
2) the Type (ocRaT) and Source (ocSRa) of
Copied** Clipboard Range Data
For Type2,
- **NOTE that CbFns Fails if the Clipboard Data was Cut, rather
the Copied, to the Clipboard (whereas it Succeeds for Type 1)
- ocRaT returns ocSRa's Range Type, as per we_RaT
- ocSRa returns the Source Range of the Clipboard Data
GetFn Succeeds for ocRaT Rel. to Sets
Cb Data Type(s) we_raNothing Output(s)
-------------+------------------+----------------+--------------------+
we_cbGet uText Or Range >= iocStr Or ocSRa
we_cbGetT uText = iocStr
we_cbGetR Range > ocSRa
we_cbGetRT Range > iocStr & ocSRa
Note that the Getting the Null String, or a Blank Range, will Succeed
BEWARE: 1) Get Functions Use, and then Delete, the Last Row and Column
of the Activesheet. The UsedRange is NOT changed (unless
the Last Row or Column originally contained Data)
2) All Get Functions, except we_cbGetR, MAY cause Excel to Crash
if there is a VERY large amount of Text Data (100's of Mbs)
in the Clipboard (eg calling we_cbGetRT after copying an
Entire Worksheet)
See CodeNotes > Excel Ranges & the Clipboard; Note that it is possible to
"mimic" a Range.Copy using Put, but Getting this string returns Type1,
and will Paste as Unformatted Text
FouC > VB >
NoOp
NoOp (
)
'(190124a)
No Operation
FouC > VB >
Del
Del (
iDur As Long )
'(190124b)
Delays the Execution of VB Code for a minimum of iDur
milliseconds,
while yielding control to the Operating System by calling DoEvents
Delays of less than about 200ms become increasingly inaccurate
The Sleep API performs a similar function without calling DoEvents
while yielding control to the Operating System by calling DoEvents
Delays of less than about 200ms become increasingly inaccurate
The Sleep API performs a similar function without calling DoEvents
FouC > VB >
wBeep
wBeep (
Optional ByVal ivNOTimes As Long = 1,
Optional iDur As Long = 500, _
If ivNOTimes is >1 the Interval Between Beeps is also iDur
Practical Limits are iDur >=50 and 250<=iFreq<=7500
Optional iFreq As Long = 1200 )
'(190124c)
Beeps ivNOTimes for iDur
Milliseconds at iFreq Hz If ivNOTimes is >1 the Interval Between Beeps is also iDur
Practical Limits are iDur >=50 and 250<=iFreq<=7500
FouC > VB > Debug >
PermDP
PermDP (
iStr As String )
'(181228b)
Permanent Debug.Print; the same as Debug.Print (iStr)
Intended for Debug.Prints that may be of Interest to All Users
Intended for Debug.Prints that may be of Interest to All Users
FouC > VB > Debug >
ActDP
ActDP (
iStr As String )
'(181228c)
Active Debug.Print; the same as Debug.Print (iStr)
ActDP() & InaDP() are Intended for Debug.Prints that are only of Interest to Developers.
They may be Replaced at an Individual, Procedure, Module or
Project level to customise the troubleshooting information being printed
ActDP() & InaDP() are Intended for Debug.Prints that are only of Interest to Developers.
They may be Replaced at an Individual, Procedure, Module or
Project level to customise the troubleshooting information being printed
FouC > VB > Debug >
InaDP
InaDP (
iStr As String )
'(181228d)
Inactive Debug.Print; Does Nothing
see ActDP()
see ActDP()
FouC > Xl > Range >
we_RaT
Range Types
Enumeration
`181228f FouC.SetFaRPars
we_raNothing
we_ra1A
we_raMA
we_ra1Ce
we_raMCes
we_raERs
we_raECs
we_raEWS
Single Area
(A1 is) a SingleCell
(A1 is) Entire Rows
Entire Worksheet (WS)
we_ra1A
we_raMA
we_ra1Ce
we_raMCes
we_raERs
we_raECs
we_raEWS
Single Area
(A1 is) a SingleCell
(A1 is) Entire Rows
Entire Worksheet (WS)
FouC > Xl > Range >
SetFaRPars
SetFaRPars (
Optional iLookIn As XlFindLookIn = xlFormulas, _
Regardless of whether they are Called by the User from Excel, or Programatically from VB,
Some Find and Replace Function Parameters are Saved every time the respective function is called.
Specifically these are,
Saved Parameter WasteNot Default
* LookIn [xlFormulas]
LookAt [xlPart]
SearchOrder [xlByRows]
** Match Case [False]
MatchByte [False]
* = Find Only
** = Replace Only
NOTES 1) the Saved Parameters are Common to both Functions
ie any Saved Parameter set using the Find Function will be used in the next call to Replace, and vice versa
2) the Find Function has a MatchCase Parameter, but it is NOT SAVED
3) the Wildcard Characters "*" and "?" may be used as a Single Character "What" Parameter in both Find and Replace Functions.
(The LookAt Parameter is redundant when the "*" is used).
4) to Find or Replace these Wildcard Characters themselves(and Tildes) , prefix them with a Tilde ie "~*", "~?" and "~~".
(Finding a single Tilde Character returns the After Cell!?, and Replacing it does nothing)
To ensure predictable results, Saved Parameters should either be
1) included in every Call to these Functions, or alternatively
2) set using this function BEFORE calling Find and/or Replace
(eg when the Find or Replace is in a Do or For Loop)
expression.Find (What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
expression.Replace (What, Replacement, LookAt, SearchOrder, MatchCase, MatchByte, SearchFormat, ReplaceFormat)
Optional iLookAt As XlLookAt = xlPart, _
Optional iSearchOrder As XlSearchOrder = xlByRows, _
Optional iMatchCase As Variant = False, _
Optional iMatchByte As Variant = False ) '190903a
Sets (Saved) Find And Replace Function ParametersOptional iSearchOrder As XlSearchOrder = xlByRows, _
Optional iMatchCase As Variant = False, _
Optional iMatchByte As Variant = False ) '190903a
Regardless of whether they are Called by the User from Excel, or Programatically from VB,
Some Find and Replace Function Parameters are Saved every time the respective function is called.
Specifically these are,
Saved Parameter WasteNot Default
* LookIn [xlFormulas]
LookAt [xlPart]
SearchOrder [xlByRows]
** Match Case [False]
MatchByte [False]
* = Find Only
** = Replace Only
NOTES 1) the Saved Parameters are Common to both Functions
ie any Saved Parameter set using the Find Function will be used in the next call to Replace, and vice versa
2) the Find Function has a MatchCase Parameter, but it is NOT SAVED
3) the Wildcard Characters "*" and "?" may be used as a Single Character "What" Parameter in both Find and Replace Functions.
(The LookAt Parameter is redundant when the "*" is used).
4) to Find or Replace these Wildcard Characters themselves(and Tildes) , prefix them with a Tilde ie "~*", "~?" and "~~".
(Finding a single Tilde Character returns the After Cell!?, and Replacing it does nothing)
To ensure predictable results, Saved Parameters should either be
1) included in every Call to these Functions, or alternatively
2) set using this function BEFORE calling Find and/or Replace
(eg when the Find or Replace is in a Do or For Loop)
expression.Find (What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
expression.Replace (What, Replacement, LookAt, SearchOrder, MatchCase, MatchByte, SearchFormat, ReplaceFormat)