vba

How to skip error in Excel VBA Program

How to skip error in Excel VBA Program The following snippet will advise on how to skip error in Excel VBA Program.  It contains “On Error”,”Resume Next”,Err.number,etc..   on error resume next ‘—-Line contain possibility of error. if err.number>0 then err.number=0 goto skip end if   skip:  

Image URLs to actual images using Excel VBA

Image URLs to actual images using Excel VBA The following program converts Image URLs to actual images using Excel VBA. It does not need to get the information using IE or Httpserver requests.   Sub URLPictureInsert()     Dim shp As Shape     Dim Rge As Range     Dim Col As Long     On Error Resume Next     Application.ScreenUpdating = False     Set Rng =...

Delete all pictures in a selected range of cells Excel VBA

Delete all pictures in a selected range of cells Excel VBA The following program Deletes all pictures in a selected range of cells Excel VBA. Sub DeletePics() Dim PicRng As Range Dim Pic As Picture Dim Rng As Range Application.ScreenUpdating = False Set Rng = Range("B1:B100") For Each Pic In ActiveSheet.Pictures Set PicRng =...

Create new CSV file with copied data using Excel VBA

Create new CSV file with copied data using Excel VBA Create New CSV file with copied data  using Excel VBA from a macro file. Besides that,  the data transfer takes place to csv with copy paste program codes. Therefore, the following program generates csv file with copied data. Sub csv_gen() Dim wb_main As Workbook...

Convert Excel Table to Normal Range VBA

Convert Excel Table to Normal Range VBA Here is the vba code to convert Excel Table to Normal Range without manual operation. ActiveSheet.ListObjects(1).Unlist Expecting that, there is only one table exists in the sheet.   http://vba.relief.jp/excel-vba-convert-table-to-range-of-cells/

Extract phone numbers using Regex in Excel vba

Extract phone numbers using Regex in Excel vba Extract phone numbers from Excel using Regular expressions in the patterns (***) ***-****. In order to extract phone numbers, where cells are mixed with strings and phone numbers; Regular expression concept play an important role.   Option Explicit Sub ewqre() Dim str As String, n As...

Delete First line of Text file and Import -Excel vba

Delete First line of Text file and Import -Excel vba Select Folder that contains the text files. It reads each text file into an array and then builds a new array (that doesn’t include the first line of each text file) first way (not verified):  Sub SO() Const fileLocation As String = “C:\Users\BloggsJ\Folder\textFile.txt” Dim...

Replace specific line of text file using Excel VBA

Replace specific line of text file using Excel VBA It includes both the first line replacement, and the last 6 characters replacement. Sub GenerateACEQueries() 'Script sourced from 'http://www.excelbanter.com/showthread.php?t=427791 'http://www.ozgrid.com/forum/showthread.php?t=181679 Dim strFileNum As String Dim rCell As Range ‘Declarations for parsing first line in text file (opening date) Dim vSz As Variant, vFilename As Variant...

Range Selection in Excel VBA

Range Selection in Excel VBA Range(“A1:J70,T1:AB70”).Select The ranges are selected separately.   Range(“A1:J70″,”T1:AB70”).Select The range including middle ones are also selected.  

Published On

December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31