dahveedoff
New Member
- Joined
- Jan 31, 2014
- Messages
- 7
Ive got a vba script i am writing that I need help with.
So I am the stage where after auto filtering the dataset in Excel, I need to copy values down a column from a particular position. So what I have done is to identify the column header I need to copy values from, offset down two cells and then copy down to the last visible cell in that column.
I am using the resize() function to try to achieve that but it doesn't seem to be working. Can someone please help look at my code to identify where I'm going wrong?
"b" in the resize function is basically a calculation of how many visible rows are left in the column after autofiltering.
The last bit at the end is needed because I want to then transpose the values I have copied, across three columns next to the column header.
Thanks
So I am the stage where after auto filtering the dataset in Excel, I need to copy values down a column from a particular position. So what I have done is to identify the column header I need to copy values from, offset down two cells and then copy down to the last visible cell in that column.
I am using the resize() function to try to achieve that but it doesn't seem to be working. Can someone please help look at my code to identify where I'm going wrong?
Code:
Set ColHeader = Range("A1:XFD1").Find(arr1(k))ColHeader.Activate
ColHeader.Offset(2, 0).Select
ActiveCell.Resize(b).SpecialCells(xlCellTypeVisible).Select
Selection.Copy
ColHeader.Offset(1, 1).PasteSpecial Transpose:=True
"b" in the resize function is basically a calculation of how many visible rows are left in the column after autofiltering.
The last bit at the end is needed because I want to then transpose the values I have copied, across three columns next to the column header.
Thanks