adding columns to the right

B

Bryan

I need to add some columns to the right edge of the data page so I can do
some charting. From this forum I got the following line that will determine
the last column.
LastColumn = ActiveSheet.Cells.Find(what:="*", SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column

After running this macro LastColum might have the value of 7 (or 8 or 9,
etc). Knowing this, how do I go to the eighth column and start adding in
some data. Here is some pseudo code of what I need to do.

LastColumn = ActiveSheet.Cells.Find(what:="*", SearchOrder:=xlByColumns,
SearchDirection:=xlPrevious).Column
NewColumn = <LastColumn + 1>
ColumnA = <find_column_with_title_x>
ColumnB = >find_column_with_title_y>

NewColumn.row_2.FormulaR1C1 = ColumnA.row2 - ColumnB.row2

Is this clear enough to solicit an answer?
Thank you,
Bryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top