PC Review


Reply
Thread Tools Rate Thread

Column Cut/Paste possible?

 
 
Kigol
Guest
Posts: n/a
 
      25th Jun 2007
1) When I use insert twice, it can create a large number of blank
columns between the sorted data and the raw data, much more than
expected for some reason. I do not want this.

2) If I cut/paste into a blank column, it errors. Apparently you
cannot paste columns?


For x = 1 To 18
Columns(x).Insert

Set testrng = Cells.Find(What:=Me.Controls("ComboBox" &
x).Value, After:=ActiveCell, LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False)

If Not testrng Is Nothing Then
testrng.EntireColumn.Cut
Columns(x).Insert '(Ideally I would like to
PasteSpecial to eliminate all the excessive column creation.)
End If
Next x

Any insight is appreciated.

 
Reply With Quote
 
 
 
 
Kigol
Guest
Posts: n/a
 
      25th Jun 2007
On Jun 25, 1:58 pm, Kigol <raw4...@aol.com> wrote:
> 1) When I use insert twice, it can create a large number of blank
> columns between the sorted data and the raw data, much more than
> expected for some reason. I do not want this.
>
> 2) If I cut/paste into a blank column, it errors. Apparently you
> cannot paste columns?
>
> For x = 1 To 18
> Columns(x).Insert
>
> Set testrng = Cells.Find(What:=Me.Controls("ComboBox" &
> x).Value, After:=ActiveCell, LookAt:=xlWhole, SearchOrder:=xlByRows,
> SearchDirection:=xlNext, MatchCase:=False)
>
> If Not testrng Is Nothing Then
> testrng.EntireColumn.Cut
> Columns(x).Insert '(Ideally I would like to
> PasteSpecial to eliminate all the excessive column creation.)
> End If
> Next x
>
> Any insight is appreciated.


On a side note does instering columns create non-blank cells? Because
after running the above code and being left with empty columns, if I
run it again blank values are pulled into my array. I have tried all
methods of blank cell testing you can suggest so there must be another
cause.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cut & Paste into column only if column cell is blank. vinhdang@gmail.com Microsoft Excel Programming 0 22nd Jun 2006 09:02 PM
Please Help: Paste Column Contents to Next Available Column Without Data mneches@gmail.com Microsoft Excel Programming 2 2nd May 2006 04:09 PM
Formula to look up a column and paste results in another column =?Utf-8?B?RE0=?= Microsoft Excel Worksheet Functions 4 28th Mar 2006 07:36 PM
paste column to row =?Utf-8?B?SGVscCB3aXRoIGV4Y2Vs?= Microsoft Excel Worksheet Functions 1 2nd Oct 2004 04:38 AM
cut and paste a text from column (B:G)to A column nancy Microsoft Excel Programming 1 24th Jan 2004 08:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:39 AM.