Filtering and then copying
I am having problems with my VB language. I have a data set which I then filter to get the data elements I need. I am having a problem with offsetting (scrolling down) from the column labels to the first row of applicable data.
So Cell "A4" is the start of the column headings. When I filter the data, the first row of data showing is in row 41.
What language do I use to go scroll down from A4 to A41? so I can then select the data elements I need.
Thanks
Re: Filtering and then copying
hi jeff,
maybe some code or the scenario to illustrate what you are trying to do? :confused:
Guessing here, but if you're trying to offset and select a cell in Excel via VB, maybe this helps:
Test1 offsets cell A4 by 37 rows and selects it
Test2 offsets cell A4 by 37 rows, gets its address and outputs it in a MsgBox
Code:
Sub Test1()
ActiveSheet.Range("a4").Offset(37, 0).Select
End Sub
Sub test2()
Dim rngNext As Range
Set rngNext = ActiveSheet.Range("a4").Offset(37, 0)
MsgBox rngNext.AddressLocal
End Sub
cheers,
ray
Re: Filtering and then copying
After using AutoFilter, try this:
Code:
Sheet1.AutoFilter.Range.Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Select
Debug.Print ActiveCell.Row
Re: Filtering and then copying
Hi Jeff,
If your filtering code happens to be scrolling some of the results out of view, then this command should scroll them back into view.
Code:
ActiveWindow.ScrollRow = 5