Another approach using dictionary [code] Private Sub UserForm_Initialize() Dim arr As Variant arr = GetDistinct(Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)) ListBox1.List =...
Thanks a lot PNRao for this great solution Another approach using collection [code] Private Sub UserForm_Initialize() Dim ws As Worksheet...
Thanks vaali... this is the data sheet1 data EID NAME PAY PayDay 14123 Joe1 $1,234.00 29-Jun-17 14124 Joe2...
HI, Here is the required macro to search a field and if value found copy the whole row into another...
I found a solution like this :Records in between two specific dates easily can be filtered using drop-down lists ....
I found a solution as follows: Watch the video to see how it's done and download example file : https://youtu.be/SZduAoOtiS0
I have sorted the above problem. Code is given below... [code] Sub seperate() Call CleanSheets MsgBox "1 of 10 Cleaning...
I programmatically generate workbooks with differing numbers of named worksheets. From time to time I programmatically add further named worksheets. I then programmatically alphabetically sort the worksheets but require a VBA generated list of the worksheets to be moved to the beginning of the workbook. The sheet is named “SheetIndex”. The sheet currently first sheet, after alphabetically sorting the worksheets, is not necessarily Sheet1, nor any other. How do I move the “SheetIndex” to the front as clearly “ActiveSheet.Move Before: = ActiveWorkbook.Sheets(1)” does not work!!
Please find solution here by clicking on the below link.
Link 1: VBA Move Worksheet Explained with Examples
Link 2: Move Method of Worksheet Object VBA
Hope it clarifies your requirement. Please do let me know, If you need any further assistance.
Thank you for your prompt response.
However I have been through the suggested link/s and the solution is not there.
The workbook/s created are actually accounting ledgers, each differing from the next. So in one workbook Sheet1 could be named “Motor Expenses” and in another be named “Electricity”, so the position of sheet1 is totally random, as is the position of every other sheet. Ideally, “Activesheet..Move BEFORE:=Sheets(Sheets.Count)” would work if it existed, but it does not!!
Hi, I have just found the solution: Private Sub MoveSheetIndexToFront() Application.ScreenUpdating = False Dim FirstSheet As String FirstSheet = Sheets(“SheetIndex”).Range(“A2”).FormulaR1C1 Sheets(“SheetIndex”).Move Before:=Sheets(FirstSheet) ActiveWorkbook.Save End Sub The sheet list is programmatically generated then I run a subsequent macro which looks up the first sheet on the list in Range(“A2”) and moves it as set down. I then move the “SheetIndex” cell in the Index to A2, thus achieving an appropriate index
Please share using the share button above.
If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.
Found the answer useful and wants to credit the user, then vote the answer (vote up).