Re: Different results for Auto Filter and Advanced Filter
Most welcome - have a great day
Re: Different results for Auto Filter and Advanced Filter
Most welcome - have a great day
Re: Different results for Auto Filter and Advanced Filter
Hi
Welcome to Ozgrid.
Make the criteria range for the AF -
Range("G2:G3")
I get 3 results when that fix is made.
Take care
Smallman
Re: Pick Date calendar in Excel 2013
Pop up Calendar in Excel
No2. Google search item.
http://www.fontstuff.com/vba/vbatut07.htm
Hope this gives you the tools to find that inner researcher in future
Take care
Smallman
Re: Conditional Formatting with Multiple Criteria Formula
This sort of problem is what conditional formatting was built for. Add to Conditional formatting.
=LEN(INDEX($C$2:$C$12,MATCH(1,INDEX(($E$2:$E$12=A2)*($F$2:$F$12=B2)*($G$2:$G$12="No"),0),0)))>0
File attached to show workings.
Take care
Smallman
Re: Sort data onto worksheets based on value
As an alternative the following loops through the sheets with the Input sheet on the far left, output sheets cascade to the right.
Sub RunonSheets()
Dim i As Integer
Dim rng As Range
Dim sh As Worksheet
Set sh = Sheet1 'Datasheet
For i = 2 To Sheets.Count
sh.Range("F1:F" & Range("F" & Rows.Count).End(xlUp).Row).AutoFilter 1, Sheets(i).Name
Set rng = sh.[A2:D2000, AE2:AE2000, BD2:BD2000]
Sheets(i).[a2].CurrentRegion.Offset(1).Clear
rng.Copy Sheets(i).[a2]
Next i
sh.AutoFilterMode = False
End Sub
Display More
File attached to show workings.
Take care
Smallman
Re: Copy/Paste top 10 visible rows/columns
Hi Ryan
We meet again?!?
This gets you over the line but you won't like it.
Sub TopNRows()
Dim i As Long
Dim r As Range
Dim rwC As Range
Set r = Range("A2", Range("A" & Rows.Count).End(xlUp)).SpecialCells(12)
For Each rwC In r
i = i + 1
If i = 10 Or i = r.Count Then Exit For
Next rwC
Range(r(1), rwC).SpecialCells(12).Copy
End Sub
Display More
Hope this puts you of the mindset that just copying the data in its fullest filtered form and then deleting the rows which exceed row 10 in your destination sheet. This will require less code and no loop.
Take care
Smallman
Re: Copy and paste dynamic range from one sheet to another
Hi Codepro
Give the following a try. It kind of builds on my prior post. Hope it helps.
Sub MoveVals()
Dim lr As Long
Dim sh As Worksheet
Set sh = Sheet1
lr = sh.Range("A" & Rows.Count).End(xlUp).Row
sh.Range(sh.Cells(lr, 1), sh.Cells(lr, 1).End(xlUp).Offset(-1, 3)).Copy
Sheet2.[a1].PasteSpecial xlPasteValues
End Sub
Take care
Smallman
Re: Autofill isn't working VBA
Hi Codepro
The end XLup part goes to the very bottom of the specified range, comes up and as soon as it hits a value it is assigned. I used the (2) to offset 1 row. It is not really that intuitive as you would expect (1) would be the offset result. However, (2) seems to be what is required to offset an extra row. It avoids writing Offset(1) and is very useful for saving space. The second part of your question is the offset by columns so offset has two arguments Offset(Row Offset, COlumn Offset) in the second example I am offsetting from column 3 to column 4 to fill the range.
Hope this helps
Take care
Smallman
Re: Filter Pivot and Hide Some Values
Hi onexc
If you just use XLs normal value filters you can filter by top 5 and show the subtotal and grand total. It is not worth creating a macro to do this inbuilt task. See report for details.
Take care
Smallman
Re: Filter Pivot and Hide Some Values
Hi Onexc
Can you provide your workbook or a moch up of it if the data is too sensitive.
Thanks
Smallman
Re: Partial lookup value
Mr Redli
In my working career, I have never come across a process I could not change. You get a lot of time at work and can always improve things which have been created with questionable construction.
Take care
Smallman
Re: Partial lookup value
Thanks for finding the link and fixing it.
I originally put the link in then tried to make it look pretty. Will repair the original.
Kjbox - it can be done but i never link formula to another workbook - ever. My workbooks are always stand alone.
Take care
Smallman
Re: Partial lookup value
Try this
=LOOKUP(2^15,SEARCH($F$3:$F$7,A2),$F$3:$F$7)
See site below for explanation.
Take care
Smallman
Re: Points Averaging Sheet using replace function
Hi
Sorry for the slow reply. First time at a computer in a day or so.
For multiple rows you might want a loop. This is not tested but something like the following - it is designed to work between rows G2 and G7.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
If Not Intersect(Target, [G2:G7]) Is Nothing Then
Application.EnableEvents = False
i = Target.Row
Range(Cells(i, 2), Cells(i, 6)) = Range(Cells(i, 3), Cells(i, 7)).Value
Cells(i, 7) = ""
End If
Application.EnableEvents = True
End Sub
Display More
Take care
Smallman
Re: Points Averaging Sheet using replace function
I can't open your attachment but set up something which runs from Row 2 not 1. Include headings in Excel spreadsheets is for the best.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [G2]) Is Nothing Then
Application.EnableEvents = False
[b2:F2] = [C2:G2].Value
[G2] = ""
End If
Application.EnableEvents = True
End Sub
This code goes in the workbook module. Remember run it from Row 2 where G2 changes. File attached to show workings.
Take care
Smallman
Re: Insert a blank row below a sequencial group
I think you need to add more than 1 blank row. Code needs to check if the sequence of 1s ends and if there is a matching sequence that ends. As much as I despise using Select this is one instance where it rocks.
Sub AddBlankRows()
Dim rng As Range
Set rng = Range("E1", Range("E65536").End(xlUp)).Offset(, 1)
rng.Offset(1) = "=IF(AND(ROW()<>2,D1<>D2),1,0)"
rng.AutoFilter 1, 1
rng.Offset(1).SpecialCells(xlCellTypeVisible).Select
rng.AutoFilter
Selection.EntireRow.Insert
End Sub
File attached to prove workings.
Take it easy
Smallman
Re: sort cells by first word
Hi primatt
Welcome to the forum. If you open the file in the link Syywriter provided, it is almost exactly what you have asked for. Even the words are eerily similar. Let us know if you have trouble adapting the solution.
Skywriter thanks for the link
Take care
Smallman
Re: Why is Option Explicit optional?
Write code as well as you possibly can but for goodness sake, for all concerned, DECLARE your variables. It does make your code easier to read. If you are not planning on being the custodian of a file for the term of your natural life for the love of god give the poor souls that pick up your file a fighting chance to understand what you are trying to do. Using Option Explicit is like creating a management summary for all who gaze upon your book of code. Happy coding!!!
Take care
Smallman