Quantcast
Channel: Excel VBA Codes & Macros
Browsing all 52 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Gantt Chart in Excel

Download and try these Templates1 Gantt Chart Using Stacked Bar ChartDownload the working file here https://www.box.com/s/pwj2rq73zg0f8bg8tckeSteps to use :Download the templateRead the instructions on...

View Article


Image may be NSFW.
Clik here to view.

Show Country Flags as Markers on X Y Chart

If you want to display the country flags as markers on X Y Scatter Chart. Snapshot below:Steps1 Download the country flags and save them in a folder2 Make sure you name the flags as labels or series...

View Article


Image may be NSFW.
Clik here to view.

Format Line Chart's Markers and Line colors Using VBA

Change the style of marker and color using VBA. Snapshot below -Download working File here All you need to create a table with series name mentioned in cells and add colors to cells next to it Snapshot...

View Article

Open a delimit notepad file in Excel

Macro to open a delimit notepad file in ExcelSub delimit_txt_file()Dim fNameAndPath As String    fNameAndPath = Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt", Title:="Select File...

View Article

Image may be NSFW.
Clik here to view.

Move List-box Items up & Down

To move list-box item up and down . Try below codeTo move UpPrivate Sub CMD_UP_Click()    If Me.lst_selectedfields.ListCount = 0 Then Exit Sub    If Me.lst_selectedfields.ListIndex = 0 Then Exit Sub...

View Article


Loop through all outlook emails saved on your desktop and extract the...

If you want to run a loop through all outlook mails you have stored on your local desktop. Try this code-'Change folder path  Public Const fldname As String = "C:\Documents and Settings\Ashish...

View Article

Image may be NSFW.
Clik here to view.

Format bubble chart using VBA

Change the style and color of bubbles using VBA. Snapshot below -All you need to create a table with series name mentioned in cells and add color to cells next to it Snapshot below -Macro to format...

View Article

Image may be NSFW.
Clik here to view.

Format X Y Chart using VBA

Change the style and color of markers using VBA. Snapshot below -All you need is to create a table with series name mentioned in cells and add color and marker style to cells next to it Snapshot below...

View Article


Loop through all List-Boxes or Combo-boxes on userform

Macro to loop through all combo-boxes and list-boxes on user-form and set the row-source Sub loop_listbox_userform()    Dim cnt As Control    ' change userform name    For Each cnt In...

View Article


Compare two worksheet ranges from same or different workbook and identify the...

Macro to compare two worksheet ranges in same or different workbook and identify cell address which does not match-Sub compare_range()    Dim basewkb As Workbook    Dim comparetowkb As Workbook    Dim...

View Article

Save Specific Worksheet as new workbook

Macro to save specific worksheet as a new workbook-Sub save_specific_worksheets_as_new_workbook()    Dim wk As Worksheet    Dim shtnames()    shtnames = Array("Sheet1", "Sheet2", "PPT") ' ADD SHEET...

View Article

Display External Links if any in the workbook

Macro to pop-up the full path of external workbooks used in the formula's Sub external_lins()    Dim extlinks    Dim j As Long    extlinks = ThisWorkbook.LinkSources(xlExcelLinks)    If Not...

View Article

Break External Workbook Links

Macro to break External Workbook Links -Sub break_external_links()    Dim extlinks    Dim j As Long    extlinks = ThisWorkbook.LinkSources(xlExcelLinks)    If Not IsEmpty(extlinks) Then        For j =...

View Article


Find cells linked to external workbook

Macro to find all cells which are linked to any external workbook-Sub find_cells_linked_to_external_workbooks()    Dim extlinks    Dim j As Long, k As Long    Dim wkb As Workbook    Dim rng As Range,...

View Article

Image may be NSFW.
Clik here to view.

Print All Formula’s used in a workbook

Macro to print all formula's used in a workbook. Snapshot below -Code - Sub all_formulas()    Dim extlinks    Dim j As Long, k As Long    Dim wkb As Workbook    Dim rng As Range, cl As Range    Dim...

View Article


Image may be NSFW.
Clik here to view.

UDF to count cells with format Bold or Italics or Strike-through or Underline

User defined function to count the formatted cells in a range. Snapshot below -Function count_values(datarng As Range, formatconditon As String)    'datarng is range to look into    'formatconditon use...

View Article

Search a text in excel workbooks and if found return the full path of workbooks

Macro to search a text in all excel workbooks saved in a folder and if text is found return the full path of workbooksSub search_text_in_excel_files()    'search a text in excel workbooks saved in a...

View Article


Search a text in word documents and if found return the full path of document

Macro to search a text in the word documents saved in a folder and return the full document path of all documents which contains the text -Sub search_text_in_word_docs()    'search a text in the word...

View Article

Copy all tables from a word document and paste them in a separate new workbook

Macro to copy all tables from a document and paste them in a separate workbook-Sub import_word_tables_seperate_workbook()    Dim objWord As Object    Dim objdoc As Object    Dim i As Integer    Dim wkb...

View Article

Copy all tables from word document to separate worksheets

Macro to copy all tables from word document to separate worksheets -Sub import_word_tables_to_seperate_sheet()    Dim objWord As Object    Dim objdoc As Object    Dim i As Integer    Dim wkb As...

View Article
Browsing all 52 articles
Browse latest View live