Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Column Cut/Paste possible?

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Column Cut/Paste possible?

On Jun 25, 1:58 pm, Kigol 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
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
Copy/paste Column Ray Excel Programming 7 November 27th 06 08:21 PM
Cut & Paste into column only if column cell is blank. [email protected][_2_] Excel Programming 0 June 22nd 06 09:02 PM
Please Help: Paste Column Contents to Next Available Column Without Data [email protected] Excel Programming 2 May 2nd 06 04:09 PM
Formula to look up a column and paste results in another column DM Excel Worksheet Functions 4 March 28th 06 07:36 PM
cut and paste a text from column (B:G)to A column nancy Excel Programming 1 January 24th 04 08:31 PM


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

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

About Us

"It's about Microsoft Excel"