Posts by GIRISHBISHT

    Sorry for breach of rules of forum.


    Sir, problem could not be resolved. The matter is I have a checkbox in my custom iribbon. When I check this checkbox, wherever I click on any cells on any worksheet, the relative row and relative column should be highlighted. VB Code replied by you and Code mentioned in the Public Function Function_Action do the same work, but only one time. I want the highlighting on every click till the Checkbox is unchecked. Can it be possible to call Public Function Worksheet_SelectionChange(ByVal Target As Range) when pressed is true.

    iRIBBON as follows:

    Code
    <checkBox id="cbHighlight" 
    label="Highlight" 
    supertip="This will highlight active Row and Column, wherever you click on the cell." 
    onAction="Function_Action" />

    Module Code:

    Code
    Public Function Function_Action(control As IRibbonControl, pressed As Boolean)
    If pressed Then
    ActiveCell.EntireRow.Interior.ColorIndex = 20
    ActiveCell.EntireColumn.Interior.ColorIndex = 20
    Else
    Cells.Interior.ColorIndex = xlColorIndexNone
    End If
    End Function
    Code
    Public Function Worksheet_SelectionChange(ByVal Target As Range)
    Cells.Interior.ColorIndex = xlColorIndexNone
    Target.EntireColumn.Interior.ColorIndex = 20
    Target.EntireRow.Interior.ColorIndex = 20
    Target.Interior.ColorIndex = xlColorIndexNone
    End Function

    Possibly...

    Sir, problem could not be resolved. The matter is I have a checkbox in my custom iribbon. When I check this checkbox, wherever I click on any cells on any worksheet, the relative row and relative column should be highlighted. VB Code replied by you and Code mentioned in the Public Function Function_Action do the same work, but only one time. I want the highlighting on every click till the Checkbox is unchecked. Can it be possible to call Public Function Worksheet_SelectionChange(ByVal Target As Range) when pressed is true.

    ' I need to call Call Worksheet_SelectionChange(ByVal Target As Range) when pressed is true

    Code
    Public Function Worksheet_SelectionChange(ByVal Target As Range)
    Cells.Interior.ColorIndex = xlColorIndexNone
    Target.EntireColumn.Interior.ColorIndex = 28
    Target.EntireRow.Interior.ColorIndex = 28
    Target.Interior.ColorIndex = xlColorIndexNone
    End Function

    I have my own ribbon, wherein there is one check box. If the checkbox is checked, highlight active row and active column, wherever I move to any cell in any worksheet. It is not working. Help me.

    Combobox1.Listindex should be 0, When I click Add Files it should redirects to open File window. When I click Combobox Arrow Key it should show two items. Click on any item depends on my requirement. One code Combobox1_Enter may be created but there should be my choice either I take Combobox1_Enter or Combobox1_Change.

    I have a userform, wherein there are one combobox with two items i.e. Add Files and Add Folder. I want to add selected files or folder in listbox after doing following:


    1. If I enter add files the browse files window open then I select file(s) and click OK, then combobox state should at its initialize state

    2. If I click on downarrow then both items show

    a) If I click on Add files then browse files window open

    b) If I click on Add folder then browse folder window open


    I have no knowledge of VBA. I need this combo like the Command Button as shown while we click DATA Tab, Connections Group, Connections Button then a userform opens. There is a button with two options Add and Add to the Data Model. How can I configure Add Files and Add Folder Combobox same as Add and Add to the Data Model Button. I am enclosing herewith Image of Excel window along with sample of userform in an Excel File. Kindly help me.

    I have many xlsx and xls files in a folder containing 2-3 worksheets in each file. I want to merge all these files into one workbook. I have a sample code but it is not merging xlsx file, it is picking only xls files of the selected folder. Sample code is mentioned below. Help me
    [CODE][


    Sub MergeFiles ()
    Dim numberOfFilesChosen, i As Integer
    Dim tempFD As FileDialog
    Dim mainWb, sourceWb As Workbook
    Dim tempWS As Worksheet
    Set mainWb = Workbooks.Add 'Application.ActiveWorkbook
    Set tempFD = Application.FileDialog(msoFileDialogFilePicker)
    'Allow the user to select multiple workbooks
    tempFD.AllowMultiSelect = True
    numberOfFilesChosen = tempFD.Show
    'Loop through all selected workbooks
    For i = 1 To tempFD.SelectedItems.Count
    'Open each workbook
    Workbooks.Open tempFD.SelectedItems(i)
    Set sourceWb = ActiveWorkbook
    'Copy each worksheet to the end of the main workbook
    For Each tempWS In sourceWb.Worksheets
    tempWS.Copy after:=mainWb.Sheets(mainWb.Worksheets.Count)
    Next tempWS
    'Close the source workbook
    sourceWb.Close
    Next i
    End Sub
    /CODE]