Trouble with InputBoxes

Here is a way to catch most outcomes of interacting with the dialog; Dim value As String value = InputBox(“Please enter a #”, “Determine Limit”, 10000) If (StrPtr(value) = 0) Then MsgBox “You pressed cancel or [X]” ElseIf (value = “”) Then MsgBox “You did not enter anything” ElseIf (Val(value) = 0 And value <> … Read more

Macros Not Showing Up in Macro Table

Macros that take arguments are not visible in the macro box because there is no point in having them there. If they need arguments to run, they cannot be run from the macro box because there is no way to supply an argument to the macro in question. Normally, a macro shows up in the … Read more

VBA: Modify chart data range

Offset function dynamic range makes it possible. Sample data Steps Define a dynamic named range =OFFSET(Sheet1!$A$2,,,1,COUNTA(Sheet1!$A$2:$Z$2)) and give it a name mobileRange Right Click on Chart Click on Select Data This screen will come Click on Edit under Legend Entries.(mobiles is selected) change the Series value to point to mobileRange named range. Now if data … Read more

Delete Hidden/Invisible Rows after Autofilter Excel VBA

So I was kind of looking to get rid of Unfiltered Data rather than trying to reverse all the criteria and delete the visible cells I would use this one: Sub RemoveHiddenRows() Dim oRow As Range, rng As Range Dim myRows As Range With Sheets(“Sheet3”) Set myRows = Intersect(.Range(“A:A”).EntireRow, .UsedRange) If myRows Is Nothing Then … Read more

Change HTML email body font type and size in VBA

I did a little research and was able to write this code: strbody = “<BODY style=font-size:11pt;font-family:Calibri>Good Morning;<p>We have completed our main aliasing process for today. All assigned firms are complete. Please feel free to respond with any questions.<p>Thank you.</BODY>” apparently by setting the “font-size=11pt” instead of setting the font size <font size=5>, It allows you … Read more

Excel VBA For Each Worksheet Loop

Try to slightly modify your code: Sub forEachWs() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Call resizingColumns(ws) Next End Sub Sub resizingColumns(ws As Worksheet) With ws .Range(“A:A”).ColumnWidth = 20.14 .Range(“B:B”).ColumnWidth = 9.71 .Range(“C:C”).ColumnWidth = 35.86 .Range(“D:D”).ColumnWidth = 30.57 .Range(“E:E”).ColumnWidth = 23.57 .Range(“F:F”).ColumnWidth = 21.43 .Range(“G:G”).ColumnWidth = 18.43 .Range(“H:H”).ColumnWidth = 23.86 .Range(“i:I”).ColumnWidth = 27.43 … Read more