Hello everyone:
Thanks for your patience and tips. I greatly appreciate it. Can I ask what
does NG mean?
Below is a sample of my data (hope it shows up the way I aligned it). The
original data had no blank columns. I recorded a macro to insert blanks next
to each data column. This is was in preparation to move all negative values
from "X Pos", "Y Pos", "Z Pos" to "X Neg", "Y Neg", "Z Neg", respectively.
This series of XX,YY, and ZZ repeats till column DO. With regards to rows,
all worksheets do not end on the same row.
In the meantime, I will take a look at the link Mark provided.
Thank you :-)
Sojo
X Pos X Neg Y Pos Y Neg Z Pos Z neg
5.15129 -4.58382 44.6704
5.24563 -4.57916 45.0446
5.37303 -4.5259 45.3144
-4.18889 34.4863 -9.0217
-4.04946 34.3694 -9.38774
"Pete_UK" wrote:
What I don't understand is if you are using columns A to DO then how
can you use column B to house the negative values from column A? Give
a bit more detail about how your data is laid out.
Pete
On Sep 26, 11:58 pm, Sojo wrote:
I am writing a macro to automate several processes. I have the following
table where column A has positive and negative values and column B is blank.
I need a formula that will find all the negative values in column A and move
them to column B. In essence, it needs to say if number in column A < 0,
then cut it and paste it into column B.
1. Original Negative
2. 3.72545
3. 3.4584
4. 3.1071
5. -0.460399
6. -0.803222
7. -1.12457
I have several excel docs each with only 1 worksheet. My columns run from A
to DO (this will be constant) and rows go to 2280 (this will not be
constant). Because of this I would prefer a macro function instead of a
formula.
IanC's gave me the following macro.
For r = 2 To 100
If Cells(r, 1).Value < 0 Then
Cells(r, 1).Copy
Cells(r, 2).PasteSpecial
Cells(r, 1).Value = ""
End If
Next
I copied and pasted the macro as is into a VB module, but it didn't work. I
don't know much about code, so can't figure out what I did wrong.