What does the $ symbol do in VBA?

Here is a Cheat Sheet for DataTypes Variable End with: $ : String % : Integer (Int16) & : Long (Int32) ! : Single # : Double @ : Decimal Start with: &H : Hex &O : Octal Comparison between VB and VB.Net (reference) Visual Studio .Net added Literal Types (reference) Value End with: (For … Read more

How do I base64 encode a string efficiently using Excel VBA?

You can use the MSXML Base64 encoding functionality as described at www.nonhostile.com/howto-encode-decode-base64-vb6.asp: Function EncodeBase64(text As String) As String Dim arrData() As Byte arrData = StrConv(text, vbFromUnicode) Dim objXML As MSXML2.DOMDocument Dim objNode As MSXML2.IXMLDOMElement Set objXML = New MSXML2.DOMDocument Set objNode = objXML.createElement(“b64”) objNode.dataType = “bin.base64” objNode.nodeTypedValue = arrData EncodeBase64 = Replace(objNode.Text, vbLf, “”) Set … Read more

Force a screen update in Excel VBA

Add a DoEvents function inside the loop, see below. You may also want to ensure that the Status bar is visible to the user and reset it when your code completes. Sub ProgressMeter() Dim booStatusBarState As Boolean Dim iMax As Integer Dim i As Integer iMax = 10000 Application.ScreenUpdating = False ”//Turn off screen updating … Read more

How to find a value in an excel column by vba code Cells.Find

Just use Dim Cell As Range Columns(“B:B”).Select Set cell = Selection.Find(What:=”celda”, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) If cell Is Nothing Then ‘do it something Else ‘do it another thing End If

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)