Hi
I have an excel 2010 file, to which I keep adding rows.
I have a hidden column J which must have the same text "x" in every used row for my pivot to work.
Since the column is hidden, I forget to update this column with "x" when I add a row, which screws up my pivot data.
Is there a way for column J to be automatically updated with value "x" when I enter data in any of the columns A-I for a row?
Thanks
Ajay
try:
=IF(COUNTA(A2:I2)>0,"x","")
Happy Excel'ing!
You mean copy paste this formula in column J of every row?
That won't work for me because sometimes I insert rows between existing rows, and such rows will again miss "x" in col J.
Any other suggestions?
tia
Ajay
Only thing I can think of is to make a macro for it, it should work regardless if the column is hidden or not. but J1 (or change the "J1" to "J2" in the macro code) needs to have the formula:
=IF(COUNTA(A1:I1)>0,"x","")
The macro will copy J1, paste down the column, then remove any excess empty cells at the bottom of column J. You will need to run it everytime you insert a new row, or after you insert all your new rows.
I know you were looking for something more automatic, you may just need to make a note to remind you to do it. Best of luck.
Marco code below:
Sub x_into_Jcol() ' ' x_into_Jcol Macro ' ' Range("J1").Select Selection.Copy Columns("J:J").Select ActiveSheet.Paste Selection.End(xlDown).Select ActiveCell.Offset(0, -1).Range("A1").Select Selection.End(xlUp).Select ActiveCell.Offset(1, 1).Range("A1").Select Range(Selection, Selection.End(xlDown)).Select Application.CutCopyMode = False Selection.ClearContents End Sub
Happy Excel'ing!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks