Vishesh's blog

Simple Multiple Source Pivot
Submitted by Vishesh on 30 January, 2012 - 19:10Follow these steps to create a pivot table from multiple sources (same of other file). See attached example file.
Steps :
1a In Excel 2003 open the PivotTable and PivotChart wizard by choosing Data -> PivotTable and PivotChart Report.
1b In Excel 2007, press Alt+DP, then type P to open the wizard as there is no equivalent menu option.
2 Choose Multiple Consolidation ranges
3 Open file B as well
4 Choose relevant page field option
5 Simply select and add the ranges (highlighted cells) from this and other file. You can choose to have as many files (A+B)
6 Select New Sheet & Finish
- Add new comment
- 99 reads

Answer to Blog
Submitted by Vishesh on 15 January, 2012 - 15:02This is the solution to blog on url
http://excelexperts.com/help
Please see attached xl file.
- 4 comments
- 215 reads

Export to and Import from Tab delimited Text file
Submitted by Vishesh on 5 January, 2012 - 14:55- Add new comment
- Read more
- 283 reads

Text/Number Validation in Text Boxes
Submitted by Vishesh on 11 December, 2011 - 17:19- Add new comment
- Read more
- 316 reads

Solution-Copy data range to new worksheet
Submitted by Vishesh on 8 November, 2011 - 18:14Solution for problem posted on url
http://excelexperts.com/copy-range-data-new-worksheet-when-matching-data...
Please see attached sheet. Click on the button provided on the sheet.
- Add new comment
- 574 reads

Customised Progress Bar
Submitted by Vishesh on 29 October, 2011 - 18:23Download the attached Excel workbook to see how the customised progress bar works. To implement this in your project simply copy the form (frmProgress) and general module (modProgressBar). And then, you just need to call ShowProgress procedure like this
Call ShowProgress("Task 4", 10)

- Add new comment
- 421 reads

VBA code to handle Access Imports and Query
Submitted by Vishesh on 21 October, 2011 - 11:22Public g_objConnection As ADODB.Connection Public Const gc_strDBPath As String = "C:\Test.mdb" Function blnConnectDatabase(strPath As String, strDBPass As String) As Boolean ' If blnFileExists(strPath) = False Then ' GoTo ErrH ' Exit Function ' End If Set g_objConnection = New ADODB.Connection On Error GoTo ErrH g_objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ strPath & ";Jet OLEDB:Database Password=" & strDBPass & ";" On Error GoTo 0 blnConnectDatabas

Solution to Forum Ques
Submitted by Vishesh on 17 September, 2011 - 07:59Solution for Forum Ques on url:
- Add new comment
- 920 reads

Rows to column solved
Submitted by Vishesh on 15 September, 2011 - 18:02Solution for problem asked in url: http://excelexperts.com/moving-data-rows-columns-depending-unique-conten...
Pls c attached sheet. I have tried to solve it using formula only (no macros as it would need more involvement).
- Add new comment
- 486 reads

Filter/Find in Array
Submitted by Vishesh on 7 August, 2011 - 07:51- Add new comment
- Read more
- 795 reads

Count Array Dimensions
Submitted by Vishesh on 6 August, 2011 - 19:31- Add new comment
- Read more
- 603 reads

Create In-Cell Chart in Excel using VBA
Submitted by Vishesh on 5 August, 2011 - 08:26Paste the following code in a general module and pass the required parameters to create an chart in a cell. This code however works with Excel 2007 onwards.

- Add new comment
- Read more
- 990 reads

Transpose Back
Submitted by Vishesh on 3 August, 2011 - 09:00Paste the following code in any module and run the Test procedure
Sub Test() Call TransposeBack(Sheet1.Range("A3:D10"), Sheet1.Range("I1")) End Sub Sub TransposeBack(rngData As Range, rngTarget As Range) Dim rngHeader As Range Dim rngId As Range Dim rngCell As Range Dim rngDest As Range Dim lngRept As Long Set rngDest = rngTarget.Offset(1) With rngData Set rngHeader = Intersect(.Rows(1), .Rows(1).O

Code generated ComboBox (ActiveX)
Submitted by Vishesh on 1 August, 2011 - 07:11- Add new comment
- Read more
- 690 reads

Web Query Solution
Submitted by Vishesh on 29 July, 2011 - 21:23Solution for problem posted on url:
http://excelexperts.com/automating-pulling-data-website
Please use the attached xl sheet. Change the symbol and click the button to see
- Add new comment
- 662 reads

Copy Picture from Web to Excel
Submitted by Vishesh on 19 July, 2011 - 16:50- 3 comments
- Read more
- 791 reads

Array to speed up (Range vs Array)
Submitted by Vishesh on 11 July, 2011 - 16:57- Add new comment
- Read more
- 871 reads

Using Array to refer to multiple sheets
Submitted by Vishesh on 10 July, 2011 - 18:41Sub DeleteMultipleSheets() Application.DisplayAlerts = False With ThisWorkbook.Worksheets(Array("Sheet2", "Sheet3")) .Delete End With Application.DisplayAlerts = True End Sub
- Add new comment
- 629 reads

Abbreviated Month name
Submitted by Vishesh on 10 July, 2011 - 18:18DO NOT take first 3 characters from a month name to get an abbreviated month name. This can give you duplicate results in some languages as first 3 characters of two months may be same.
I have encountered this with the Czech language.
So, use the following:
If the month is 1 i.e. January
So, to get abbreviated month name ALWAYS use
Monthname(1, True)
This will always return standard abbreviated month name.
- Add new comment
- 582 reads

Deleting all charts & shapes on a sheet
Submitted by Vishesh on 9 July, 2011 - 21:07sub DeleteAllCharts() Sheet1.ChartObjects.delete End Sub
sub DeleteAllShapes() Sheet1.Shapes.SelectAll Selection.Delete End Sub
- Add new comment
- 556 reads

Create Chart from Array values
Submitted by Vishesh on 9 July, 2011 - 20:39Sub CreateChartFromArray() Dim objCht As ChartObject With Sheet1 Set objCht = .ChartObjects.Add(10, 20, 500, 200) objCht.Chart.ChartWizard .Cells(1) objCht.Chart.SeriesCollection(1).Values = Array(56, 61, 45, 15, 30, 10) objCht.Chart.SeriesCollection(1).XValues = Array("A", "B", "C", "D", "E", "F") End With Set objCht = Nothing End Sub
- 2 comments
- 834 reads

Export Excel Range to Word Document in a Tabular Format
Submitted by Vishesh on 9 July, 2011 - 20:08- Add new comment
- Read more
- 585 reads

Zoom Select Range
Submitted by Vishesh on 9 July, 2011 - 19:59Sub ZoomRange(rngZoom As Range) Application.Goto rngZoom ActiveWindow.Zoom = True End Sub Sub Test() Call ZoomRange(Sheet1.Range("A1:L23")) End Sub
- Add new comment
- 471 reads

Regular Expression to validate Email address
Submitted by Vishesh on 9 July, 2011 - 19:36Public Function blnEmailValid(ByVal strEmailAdd As String) As Boolean With CreateObject("VBScript.RegExp") .IgnoreCase = True .Global = True .Pattern = "^([a-zA-Z0-9_\-\.]+)@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$" blnEmailValid = .Test(strEmailAdd) End With End Function Sub Test() MsgBox blnEmailValid("abc@EE.com") End Sub
- Add new comment
- 700 reads

Remove Duplicates (Get Uniques) Excel 2007
Submitted by Vishesh on 9 July, 2011 - 19:08Sub RemoveDups(rngDups As Range, Optional rngTarget As Range) If rngTarget Is Nothing Then rngDups.RemoveDuplicates Columns:=1, Header:=xlNo Else rngDups.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=rngTarget, Unique:=True End If End Sub Sub Test() Call RemoveDups(ActiveSheet.Range("A1:A10"), ActiveSheet.Range("D1")) End Sub
- Add new comment
- 643 reads

Simple way to add Event Proc skeleton in a sheet module
Submitted by Vishesh on 1 July, 2011 - 17:08Sub CreateEventProcedure(wks As Worksheet, strEvtProc As String) With ActiveWorkbook.VBProject.VBComponents(wks.CodeName).CodeModule 'Add the blank procedure .CreateEventProc strEvtProc, "Worksheet" End With End Sub Sub TestProc() Call CreateEventProcedure(ThisWorkbook.Worksheets("Sheet2"), "Activate") MsgBox "Goto Sheet2 module in the code window. The activate procedure skeleton is added.", vbInformation, "Excel Experts" End Sub
- 2 comments
- 499 reads

Calling macro (with/without parameters) from other workbook
Submitted by Vishesh on 13 May, 2011 - 17:21- Add new comment
- Read more
- 1202 reads

Open/Close CD Tray using VBA
Submitted by Vishesh on 11 May, 2011 - 17:22Declare Sub mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String, _ ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, _ ByVal hwndCallback As Long) Sub CDTrayOpen() mciSendStringA "Set CDAudio Door Open", 0&, 0, 0 End Sub Sub CDTrayClose() mciSendStringA "Set CDAudio Door Closed", 0&, 0, 0 End Sub
- Add new comment
- 787 reads

Check if VBProject is protected
Submitted by Vishesh on 11 May, 2011 - 08:53Function ProtectedVBProject(ByVal wb As Workbook) As Boolean Dim intVBComp As Integer intVBComp = -1 On Error Resume Next intVBComp = wb.VBProject.VBComponents.Count If Err.Number = 1004 Then MsgBox "Add reference to the Microsoft Visual Basic Extensibility Library", vbCritical, "Excel Experts" End If On Error GoTo 0 If intVBComp = -
- Add new comment
- Read more
- 626 reads

Show Font List with Example
Submitted by Vishesh on 11 May, 2011 - 08:32Sub ShowInstalledFonts() Const StartRow As Integer = 4 Dim cbcFontName As CommandBarControl, cbrFontCmd As CommandBar, strFormula As String Dim strFontName As String, i As Long, lngFontCount As Long, intFontSize As Integer intFontSize = 10 If intFontSize = 0 Then Exit Sub If intFontSize < 8 Then intFontSize = 8 If intFontSize > 30 Then intFontSize = 30 Set cbcFontName = Application.CommandBars("Formatting").FindControl(ID:=1728)
- Add new comment
- Read more
- 937 reads

Recent comments
11 hours 23 min ago
18 hours 40 min ago
21 hours 33 min ago
21 hours 38 min ago
1 day 12 hours ago
1 day 12 hours ago
1 day 22 hours ago
2 days 14 hours ago
3 days 14 hours ago
3 days 15 hours ago