Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Move data to right with variable rows

I have a large spreadsheet with corrupted data. I can identify several types
of bad data and have correct the data in these rows but one particluar type
is giving me problems.

Because the spreadsheet is large I used filtering and visible cell commands
to correct blocks of data. This seems to work fine but one type is still not
working so I am trying a row by row logic search. In this case the bad data
needs to move from cell column B to C with the range through L. So any data
in the range B through L in the selected row is copied if the contents of L
="N". A cell is inserted at B and the data shifted to the right by one cell.
The rows is a variable. and I have a header at the top to ignore.

My Code at the moment looks like this

With ActiveSheet
Dim pointer As Long
For pointer = .UsedRange.Rows.Count To 2 Step -1
If .Cells(pointer, "L") = "N" Then
Range("B" & pointer).Select
Selection.Insert Shift:=xlToRight, _
CopyOrgin:=xlFormatFromLeftOrAbove
End If
Next
End With

This does not work and will also be slow. Any Suggestions?
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
How to move data from rows to columns How to move data from rows to columns Excel Discussion (Misc queries) 6 October 13th 09 10:16 AM
move data from rows to columns DME[_2_] Excel Programming 0 July 23rd 08 05:47 PM
MOVE DATA INTO UNUSED ROWS sailmore50 Excel Worksheet Functions 0 July 26th 06 12:14 PM
Move Data from rows to columns... Dan B Excel Worksheet Functions 2 January 6th 06 04:47 PM
Move Column data to rows poppy Excel Programming 2 December 8th 05 09:19 AM


All times are GMT +1. The time now is 04:42 AM.

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"