Clueless about using cut and copy with offset
Yes, the values can be deleted...Sorry, I maybe misunderstood there are too
many ways to say the same thing.
"Thomas [PBD]" wrote:
Jeremiah,
What I meant was that once the cutting is placed into the correct line the
line the data came from would be blank. Would you like it deleted. I wrote
this quick macro here where you can remove the ' in front of the delete
statement if you wish to use it.
Public Sub Cut_Offset()
y = Excel.WorksheetFunction.CountA(Columns("B:B"))
For x = 1 To y
If Cells(x, 2).Value = "Date" Then
If Cells(x, 3).Value = "" Then
Range(Cells(x + 1, 3).Address & ":" & Cells(x + 1, 15).Address).Cut
Cells(x, 3).Select
ActiveSheet.Paste
Application.CutCopyMode = False
' Rows(x + 1).Delete ' Delete Statement
End If
End If
Next
End Sub
This will count the number of rows that say "Date" in Column B, copy the row
below it from C:O and place it the row above it. Optional delete blank row.
--
--Thomas [PBD]
Working hard to make working easy.
Answered your question? Click ''Yes'' below.
"jeremiah" wrote:
Just blank, deleting will misalign the rest of the spreadsheet
"Thomas [PBD]" wrote:
Jeremiah,
Would you like the row that you are cutting from to be deleted once the
process is completed (as it should be blank)?
--
--Thomas [PBD]
Working hard to make working easy.
Answered your question? Click ''Yes'' below.
"jeremiah" wrote:
I am trying to figure out the following....If the value of column B = "Date"
and columns C:O are empty, cut and copy the values from columns C:O in the
row directly below. Example below, the numbers in the row need to line up
with Date. The file was an imported csv file so sometimes the rows line up
and other times they don't.
Date
493,352 102.98 4,791 30.88 58,072 1,881
|