This VBA video will teach you VBA code related to interacting with excel range. This topic is multi part series.
Below are the used codes demonstrated in video.
Sub CombineRange()
'6- Combine two or more ranges using Union.
Application. _
Union(Range("A1"), Range("B5"), Range("A5")).Value = "KPT"
End Sub
'-----------------------------------------------------------
Sub CommonRange()
'Get common range or cell between two ranges using Intersect.
Application. _
Intersect(Range("A3:E10"), Range("D7:G14")).Value = "$"
End Sub
'----------------------------------------------------------------------------------
Sub SelectSpecialCells()
'SpecialCells method of selecting and manupulation_
'range or cells.
'****SPECIALCELLS is PROPERTY of RANGE OBJECT
''====select cells cotaining formula
Range("A1"). _
CurrentRegion.SpecialCells(xlCellTypeFormulas, 16).Select
''above code can be used check whether formula present
'in a range or not, depending on the do something
''like msgbox to alert user
'==============================
''====fill blank cell with default rate
Range("A2:A15").SpecialCells(xlCellTypeBlanks).Value = 10
End Sub
'----------------------------------------------------------------------------------------
Sub TextFoundAlertAndACtion()
''==can be used for datavalidation alert
''RANGE B2 TO B15 ONLY QTY INPUT shoud be there
'' if text found then alert user and delete those text
On Error GoTo EXT
If Range("B2:B15"). _
SpecialCells(xlCellTypeConstants, xlTextValues).Cells.Count "gt" 0 Then
' at "gt" place write greater than sign
MsgBox "Text is not allowed in range B2 TO B15" & vbNewLine _
& "Text cells going to be deleted" & vbNewLine _
& "Please enter some numerical value"
Range("B2:B15") _
.SpecialCells(xlCellTypeConstants, xlTextValues).ClearContents
Else
End If
EXT:
End Sub
=====================================================
Websites
www.juggle.biz
=====================================================
You can also watch below videos by clicking provided link.
-VARIOUS WAYS TO RUN VBA OR MACRO
• Various ways to run macro or VBA in E...
-USED RANGE and CURRENT REGION IN EXCEL [HD]
• USED RANGE and CURRENT RANGE OR REGIO...
-SHORTCUT KEY FOR SUBTOTAL FORMULA (TRICK). [HD]
• Shortcut key for SUBTOTAL formula (TR...
-HLOOKUP IN EXCEL (HOW AND WHEN TO USE?) [HD]
• HLOOKUP IN EXCEL (HOW AND WHEN TO USE?)
Excel VBA to INTERACT with RANGE or CELL PART 1 [HD]
• Excel VBA to INTERACT with RANGE or ...
Смотрите видео Excel VBA to INTERACT with RANGE or CELL- PART 2 [HD] онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь LearnYouAndMe 23 Май 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 199 раз и оно понравилось 1 людям.