Category: Excel-Macro-VBA

2

VBA Excel – Cells, Ranges and Offset: Refer to Cells by Using Shortcut Notation

You don’t have to type Range every time, you have shortcut for that, ‘Brackets’. Shortcut for referring one cell. Worksheets(“Sheet1”).[G5].Interior.ColorIndex = 45 Instead of using Range(“G5”), you can use [G5]. Shortcut for referring range...

3

VBA-Excel: Clear data from Excel Sheet(WorkSheet)

VBA-Excel: Clear data from Excel Sheet(WorkSheet) Format: WorkBook.WorkSheet.Range.Clear          Examples: mainworkBook.Sheets(3).UsedRange.Clear Clear data from particular cell: Dim mainworkBook As Workbook Set mainworkBook = ActiveWorkbook mainworkBook.Sheets(“MyFirstMacro”).Range(“A2”).Clear

2

VBA Excel – Cells, Ranges and Offset : Offset

Offset: Offset property in VBA-Excel is used along with Range. With the help of Offset property user can move around in the sheet. Format: Range(“StartingPoint”).Offset(NoOfRowsToBeMoved , NoOfColumnsToBeMoved) Example : Range(“A2”).Offset(1,0).Select And compiler reads, move...

0

FileSystemObject : GetParentFolderName Method

Description: Returns the parent folder name. Format : objectOfFileSystemObject. GetParentFolderName(filepath) objectOfFileSystemObject : As the name says, it’s a FileSystemObject. Arguments: filepath Mandatory Type:     String File path for which Parent Folder is to be return.

0

FileSystemObject : DriveExists Method

Description: Returns True if a specified drive exists; False if it does not. Format : objectOfFileSystemObject. DriveExists(DriveName) objectOfFileSystemObject : As the names says, it’s a FileSystemObject. Arguments: fileName Mandatory Type:     String Drive name ,...

0

FileSystemObject : GetExtensionName Method

Description: Returns extension of a file, return empty string if file doesn’t exist. Format : objectOfFileSystemObject. GetExtensionName(filepath) objectOfFileSystemObject : As the names says, it’s a FileSystemObject. Arguments: filepath Mandatory Type:     String filepath , whose...

0

FileSystemObject : GetDriveName Method

Description: Returns drive name, corresponding to the file name. Format : objectOfFileSystemObject. GetDriveName(filepath) objectOfFileSystemObject : As the names says, it’s a FileSystemObject. Arguments: filepath Mandatory Type:     String filepath , whose parent drive to be...

Show Buttons
Hide Buttons
%d bloggers like this: