Can I get some help coding something like the following:
If Range("E1").value = "YTD" then
'cut columns E, F, G
'paste columns E, F, G in front of column B
end if
Basically I want to swap three YTD columns to the front. I know how to grab
one column, Range("E1").EntireColumn, for instance, but how do I grab two
more adjacent columns? Or do I have two cut and paste three times?
I won't know in advance how many rows there might be.
Thanks in advance,
David Portwood
Alan - 26 May 2008 04:21 GMT
Using the macro recorder will show you what you want but it won't be as clean
as this:
If Range("E1").value = "YTD" then
Columns("E:G").Cut
Columns("B:B").Insert Shift:=xlToRight
End If
Alan
> Can I get some help coding something like the following:
>
[quoted text clipped - 11 lines]
> Thanks in advance,
> David Portwood
David Portwood - 26 May 2008 07:25 GMT
Perfect! I was hoping there would be something simple and direct just like
this. Thank you, Alan.
> Using the macro recorder will show you what you want but it won't be as
> clean
[quoted text clipped - 23 lines]
>> Thanks in advance,
>> David Portwood