#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Columns

Hello,

I copied a table from Word into an Excel spreadsheet (this Word table was
created by copying rows in from other tables). There was just one problem:
some of the data shifted to the right. It affects just the last 3 columns at
the right -- specifically, the last 3 columns, which are City, State, and Zip
Code.

In the Word table they look like this:

City State Zip
New York NY 11222
New York NY 11223
New York NY 11224
New York NY 11225
.... etc.

When I copied the table into Excel, this is what happened:

City State Zip (Next Column)
New York NY 11222
New York NY 11223
New York NY 11224
New York NY 11225
New York NY 11226
New York NY 11227

I have been just selecting and moving the data to the left, but there are
4,000 rows and it's taking forever.

Is there something I can do before copying the Word table into Excel that
will prevent this from happening?

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Columns

Rosemary

Try this. Right click the worksheet view code and paste this in:-

Sub stantial()
lastrow = Range("B65536").End(xlUp).Row
For X = lastrow To 1 Step -1
If Cells(X, 2).Value = "" Then
Cells(X, 2).Select
Selection.Delete Shift:=xlToLeft
End If
Next
End Sub

This assumes your indented column is Column B. To change it obviously change
the B in the first line to the correct column but also change the 2 in
If Cells(X, 2).Value = "" Then
Cells(X, 2).Select
The correct column number (2=b, 3=c etc)

Mike

"Rosemary" wrote:

Hello,

I copied a table from Word into an Excel spreadsheet (this Word table was
created by copying rows in from other tables). There was just one problem:
some of the data shifted to the right. It affects just the last 3 columns at
the right -- specifically, the last 3 columns, which are City, State, and Zip
Code.

In the Word table they look like this:

City State Zip
New York NY 11222
New York NY 11223
New York NY 11224
New York NY 11225
... etc.

When I copied the table into Excel, this is what happened:

City State Zip (Next Column)
New York NY 11222
New York NY 11223
New York NY 11224
New York NY 11225
New York NY 11226
New York NY 11227

I have been just selecting and moving the data to the left, but there are
4,000 rows and it's taking forever.

Is there something I can do before copying the Word table into Excel that
will prevent this from happening?

Thanks,

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
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
to convert columns to rows having mulit independent group columns Quacy Excel Worksheet Functions 1 August 22nd 06 11:20 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 2 July 31st 06 09:45 PM
Combine multiple columns into two long columns, Repeating rows in first column [email protected] Excel Discussion (Misc queries) 0 July 31st 06 05:07 PM
Pivot Table Creating New Columns that Subtract Two Existing Columns den4673 Excel Discussion (Misc queries) 3 December 17th 04 01:31 PM


All times are GMT +1. The time now is 02:10 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"