LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Finding/Moving Columns within Macro


So I need some advice/direction on how to perform this macro a little
more efficiently.
Everyday I export a report from our POS system at work into Excel. The
issue with the export is that none of the columns are in order so I
have to manually move the columns each time or create a macro to do
it. Currently I'm using the below code to find the column header and
move it to the correct location.

Dim intWarehouse

intWarehouse = Cells.Find(What:="Warehouse").Column
Columns(intWarehouse).Select
Selection.Cut Destination:=Columns("A:A")

I only have 15 columns that I need to find and then move but I would
think there has to be a more efficient way of doing this than creating
15 variables and using 3 lines of code for each column that I need to
find then move. For some reason I think I should be using an array but
after doing some research on arrays I'm even more confused on where to
start.

Is there a better way to do this? If so, can you point me in that
direction?

Thanks in advance -
Jake
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Columns Macro miss_mas Excel Programming 3 July 25th 08 08:12 PM
Finding specific data and moving it to a new sheet LauraD Excel Programming 0 July 10th 06 11:07 AM
Need help with Macro in moving columns Brett Smith[_2_] Excel Programming 1 January 11th 06 06:48 PM
moving to relative location after finding data Frank Kabel Excel Programming 1 March 3rd 04 06:57 PM
Finding and moving hypens from end to beginning of cell Amy[_5_] Excel Programming 2 December 9th 03 01:15 PM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"