Hello,
i'm completely new to VBA
I receive the following error 1004 Application-defined or object-defined error.
the following code is processing this error.
Cells(1, lastcol + 1) = "xxxxxx"
Columns(lastcol + 1).NumberFormat = "0%"
lastcol = .Cells(1, .Columns.Count).End(xlToLeft).Column
lastRow = .Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To lastRow
'Range(.Cells(r, lastcol), .Cells(lastRow, lastcol)).Formula = "=100%-M2"
'Range(.Cells(r, lastcol + 1), .Cells(lastRow, lastcol + 1)).Formula = "=100%-(" & .Cells(r, lastcol) = .Cells(r, lastcol)
Range(.Cells(r, lastcol), .Cells(lastRow, lastcol)).Formula = "=100%-(" & .Cells(r, lastcol - 1) & ")"
Next
What needs to be accomplished is that assumes that he is 100% minus the value in the previous cell is value in cell
<tbody>
</tbody>
Can somebody help me here
Rgds,
John
i'm completely new to VBA
I receive the following error 1004 Application-defined or object-defined error.
the following code is processing this error.
Cells(1, lastcol + 1) = "xxxxxx"
Columns(lastcol + 1).NumberFormat = "0%"
lastcol = .Cells(1, .Columns.Count).End(xlToLeft).Column
lastRow = .Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To lastRow
'Range(.Cells(r, lastcol), .Cells(lastRow, lastcol)).Formula = "=100%-M2"
'Range(.Cells(r, lastcol + 1), .Cells(lastRow, lastcol + 1)).Formula = "=100%-(" & .Cells(r, lastcol) = .Cells(r, lastcol)
Range(.Cells(r, lastcol), .Cells(lastRow, lastcol)).Formula = "=100%-(" & .Cells(r, lastcol - 1) & ")"
Next
What needs to be accomplished is that assumes that he is 100% minus the value in the previous cell is value in cell
a | b | c | d |
50 | 36 | 73% | =100%-c1=d% |
<tbody>
</tbody>
Can somebody help me here
Rgds,
John