IT WORKS!!!!!!!!
Here is the finished code.
Sub ReverseRows()
'
' ReverseRows Macro
' Flip selected signal
'
'User selects selects the desired rows an then they go to dialog-special-constants selects
'the range of cells between, and including, columns "C" and "O" that are with in the user selected rows.
Dim C As Long
Dim I As Long, J As Long
Dim r As Long
Dim NewData As Variant
Dim OldData As Variant
Dim rng As Range
'''''Check if there is data
If Range("A1").Value <> "CONDUIT NUM" Then
Exit Sub
End If
'''''Flip selected rows about the WIRENO column !!!!At this time only one continues selection can be flipped more then one selection will cause error!!!!
Selection.SpecialCells(xlCellTypeConstants, 2).Select
Set rng = Selection
For Each rng In Selection.Areas
OldData = rng.Value 'the values of the selected range is stored in OldData
ReDim NewData(1 To rng.Rows.Count, 1 To rng.Columns.Count) 'Arrey for number of rows(value changes) and number of columns (value should always be 13) the user selected
For I = 1 To UBound(OldData, 1) 'number of rows to process
r = r + 1
For J = UBound(OldData, 2) To 1 Step -1 'number of columns to proces
C = C + 1
NewData(r, C) = OldData(I, J) 'current row being processed from OldData. flips cell values about column "I" staring with the right side moving moving to the left. The values new location is stored in NewData.
Next J
C = 0
Next I
r = Empty
rng = NewData 'the new value locations are applied to the current selection
Next rng
End Sub
Thank you Izandol & xladept! I really appreciate the help you provided!
Bookmarks