Import data from SQL
Macro to import data from SQL using ADO connection string:Sub Import_data_from_SQL()' Tools -> References -> Microsoft Active Data object 2.0Dim rs As ADODB.RecordsetDim cnn As...
View ArticleFilter rows on comment text
Macro to hide and unhide the rows on comment textOption Compare TextSub filteroncomments()Dim commenttext As StringDim commentrng As RangeDim cl As RangeWith ActiveSheet .FilterMode = False...
View ArticleCreate Sunburst chart in Excel
Create Sunburst Chart in Excel using Doughnut Steps to createDownload the template linkMake sure data is sortedClick on prepare data buttonChoose the level from the drop -downSelect the chart to...
View ArticleConnect states with arrows US Map using X Y Scatter Chart
Create connections on map using X Y ScatterDownload the working file here https://app.box.com/s/6oks8mpammnza49tg3k6luhgx7rc5ybpCode to create connections:Option Compare TextOption Explicit' for any...
View ArticleModify Access Table using recordset in Excel VBA
Macro to modify access table using record-set in Excel VBASub update_access_table() ' Tools Refrences set microsoft active x object ' clear exiting data ' run query using where clause , field...
View ArticleType your Sql Query In inputbox in excel and import data from access to excel
Type Sql Query in input box and import data to excel from Access TableSub import_data() ' Tools Refrences set microsoft active x object ' clear exiting data Dim sqlstring As String...
View ArticleUpdate Access Table from Excel using VBA
Macro to update access database using Update query in Excel VBASub run_sql() Dim sqlquery As String sqlquery = "UPDATE tbl_sample SET tbl_sample.rname = ""a"" WHERE [tbl_sample.rname]=""z1"";"...
View ArticleAppend Data to Access Table from Excel
Macro to export Excel range to Access tableSub export_data() ' table to insert, workbook ,range to export Call insert_data("tbl_sample", ThisWorkbook, Sheet1.Range("a1:b9"))End SubSub...
View ArticleImport Data from Access Table
Macro to import data from access table using Excel VBAOption ExplicitSub import_data() ' Tools Refrences set microsoft active x object ' clear exiting data...
View ArticleExport Range in Json Format
Macro to Export Range in Json FormatOption ExplicitSub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoexport As Range Dim rowcounter As Long Dim columncounter As Long...
View ArticleUDF to Check Cell is having Validation or not
UDF To Check Cell is having validation or not:Function is_validation(rng As Range) As Boolean Dim i On Error Resume Next i = rng.Validation.Type On Error GoTo 0 If i = 3 Then...
View ArticleExport Range to Pipe Delimit Text File
Macro to export range to pipe delimit textfile -Option Base 1Option ExplicitSub export_range_pipe_delimit()Dim arr As VariantDim i As Long, j As LongDim line As StringDim filename As StringDim rng As...
View ArticleCopy 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 ArticleCopy 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 ArticleSearch 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 ArticleSearch 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 ArticleUDF 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 ArticlePrint 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 ArticleFind 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 ArticleBreak 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