https://repl.it/@appbrewery/ day-2-start LEC 18 - Intro of todays goals ================================================================== LEC 19 - Data Type 1 - Strings Any thing Written in " " (double Quotes) and ' ' (Single Quotes) ----------------------------------------------------------------------------------------------------------------------- 2 - Integers # Any Whole number in programming is known as INTEGERS ------------------------------------------------------------------------------------------------------------------------ 3 - Float 3.145 ------------------------------------------------------------------------------------------------------------------------- 4 - Boolean True False # First Letter should be capital -------------------------------------------------------------------------------------------------------------...
Adding Title - input box Sub Simple_InputBox() Dim myinp As String myinp = VBA.Interaction. _ InputBox(prompt:="Please input Subtitle", Title:="Subtitle please ") If myinp = "" Then Exit Sub Range("A2").Value = Excel.WorksheetFunction.Proper(myinp) End Sub Input Box to add name in new line Sub VBA_InputBox() Dim Cname As String Dim NextRow As Long Cname = InputBox("CustomerName", "Name Please..") NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1 Range("A" & NextRow).Value = Cname Debug.Print NextRow End Sub
Task 1 - Add data , add Amount Sub Excel_InputBox() Dim Cname As String Dim NextRow As Long Dim CAmount As Long Cname = InputBox("CustomerName", "Name Please..") NextRow = Cells(Rows.Count, 1).End(xlUp).Row+ 1 Range("A" & NextRow).Value = Cname CAmount = Excel.Application _ .InputBox(Prompt:="Please Input Amount", Title:="Amount..", Type:=1) Range("B" & NextRow).Value = CAmount Debug.Print NextRow End Sub Task 2 : Identify Blank Cells Sub Excel_InputBox_Range() Dim myRange As Range Dim cellBlank As Long, cellNum As Long, cellOther As Long On Error GoTo leave Set myRange = Application.InputBox("Count the number of cells", "Checking Cells...", , , , , , 8) 'Debug.Print myRange.Address cellBlank = Excel.WorksheetFunction.CountBlank(myRange) cellNum = Excel.WorksheetFunction.Count(myRange) cellOther = Excel.WorksheetFunction.CountA(myRange) - cellNum MsgBox cellBlank & "cells are blank....
Comments
Post a Comment