What do you want to save?
Add Code snippet
New code examples in category VBA
-
Jeff Handley 2021-09-15 09:18:03
excel vba shift range
' Returns a shifted version of initial range (same size) Function ShiftRange(ByVal pRange As Range, ByVal pRowOffset, ByVal pColumnOffset) Set ShiftRange = pRange.Offset(pRowOffset, pColumnOffset) End Function '---------------------------------------... Add solution -
Jazzy 2021-09-15 06:57:02
excel vba convert cells address
' From Cells(1,1) to "A1" MsgBox Cells(1, 1).Address(RowAbsolute:=False, ColumnAbsolute:=False) ' From "A1" to Cells(1,1) MsgBox Range("A1").Row & ", " & Range("A1").Column Add solution -
Bob Shank Jr. 2021-09-15 05:39:02
excel vba range.text
'Go with: Range.Value2 '<------Best way 'It is almost always the best choice to read from or 'write to an Excel cell or a range... from VBA. 'Each of the following can be used to read from a range: v = [a1] v = [a1].Value v = [a1].Value2 v = [a1].Tex... Add solution -
Philipmodest 2021-09-14 23:28:04
excel vba last column in range
'VBA to get the last row in column A that has a value. 'Change `A` to the column you care about: With Sheet1 LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row End With 'A shorter way: LastRow = Sheet1.[A1048576].End(xlUp).Row 'And to get... Add solution -
Local Ghanian 2021-09-14 15:17:03
vba error handling message
Dim Msg On Error GoTo errorhandling ' Defer error handling. ' code goes here, where potential problem occours errorhandling: ' Check for error, then show message. If Err.Number <> 0 Then Msg = "Error # " & Str(Err.Number) & &... Add solution -
Bhavneet Singh Bajwa 2021-09-14 12:14:01
excel vba isdate
Dim MyVar, MyCheck MyVar = "04/28/2014" ' Assign valid date value. MyCheck = IsDate(MyVar) ' Returns True. MyVar = "April 28, 2014" ' Assign valid date value. MyCheck = IsDate(MyVar) ' Returns True. MyVar = "13/32/20... Add solution -
-
Mikiasda 2021-09-14 05:37:02
excel last used row
Dim rLastCell As Range Set rLastCell = ws.Cells.Find(What:="*", After:=ws.Cells(1, 1), _ LookIn:=xlFormulas, LookAt:= xlPart, SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, MatchCase:=False) MsgBox ("The last used column... Add solution
Best helpers
Mike Evering
+5
Olek Wojnar
+5
BetaTester
+5
Chris
+5
ZhenYu Wang
+5
Jane Lautner
+5
Dubuisso
+5
Lvoyster
+5
Sebau-nu-mu
+5
Renato
+5
Jrdn
+5
Grendeld
+5
Englisholic
+5
Angie M
+5
Crapsy
+5
Sue E
+5
Developer63
+5
M Mason
+5
Dudus
+5
Phl3tch
+5