What do you want to save?
Add Code snippet
New code examples
-
VBA 2021-11-19 22:31:12
excel vba check if specific bits set in int32
'Fast VBA function to test if specific bits are set 'within a 32-bit Long integer. If ALL specified bits are set then 'this function returns True. If ANY of the specified bits are 'not set then this function returns False. 'Bits are numbered from 0 to ... Add solution -
VBA 2021-11-19 06:20:10
excel vba how to check if a worksheet cell is empty
'VBA to check if cell A1 is blank. 'The best way: MsgBox IsEmpty([A1]) 'But if a formula that returns a zero-length string is in A1, 'IsEmpty() will return False. 'Another way: MsgBox Len([A1]) = 0 'Len() will report 0 if A1 contains a formula that re... Add solution -
VBA 2021-11-18 17:36:12
excel vba clear contents and formatting of cell with a single command
'To clear a worksheet range from VBA, use one of 'the 'Clear' methtods: [A1].Clear '<-- clears everything in the Range cells [A1].ClearFormats '<-- clears only the formats [A1].ClearContents '<-- clears values but not formats [A1]... Add solution -
VBA 2021-11-18 01:12:19
xl-vba how to return result from a function
'In VBA, you assign the return value to the name of the function. 'This is different from many languages that use the 'return' keyword: Function Yesterday() As Date Yesterday = Date() - 1 End Function 'VBA functions can be called from other VBA code: ... Add solution -
VBA 2021-11-17 22:29:14
How do I put double quotes in a string in xl vba
'Including double-quote characters in VBA string literals can be confusing. 'First, realize that VBA (unlike many languages) does not recognize the 'apostrophe as a quotation mark. In JavaScript, for example you can simply 'do this: ' var s = 'The "... Add solution -
VBA 2021-11-17 20:39:12
excel VBA return a result function
'In VBA, you assign the return value to the name of the function. 'This is different from many languages that use the 'return' keyword: Function Yesterday() As Date Yesterday = Date() - 1 End Function 'VBA functions can be called from other VBA code: ... Add solution -
VBA 2021-11-17 13:35:12
excel vba convert and entire range to uppercase
'To convert the entire worksheet range A1:C99 to UPPER case, use the 'following VBA: [a1:c99] = [index(upper(a1:c99),)] 'Or use this Sub: Sub ToUpper(r As Range) r = Evaluate("index(upper(" & r.Address & "),)") End Sub ... Add solution