Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default inserting a column to the right

I need to insert a column in two ways.
First, I need to find a column by searching for the text "AZoriginal", then
insert a column to the right named "AZ". I will need to add this formula to
row 2 of that new column

if ( x2 < 0, x2 + 360, x2 )

where x is the column where "AZoriginal" was found. Actually I need to copy
the formula down to the bottom row but I have another macro that I think I
can use as a template and acomplish that.


Second I need to add a new column to the far right end of the data. Then I
will insert another formula. Once I see the first and how to add a column
to the far right, I should be able to figure out the rest.

--
Thank you,
Bryan Kelly
Time is the medium we use to express out priorities.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default inserting a column to the right

Bryan,

This should work for you:

Sub InsertColumnEnterFormula()
Dim myCell As Range
Set myCell = Cells.Find("AZoriginal")
With myCell
.Offset(, 1).EntireColumn.Insert
.Offset(2 - .Row, 1).FormulaR1C1 = "=IF(RC[-1]<0,RC[-1]+360,RC[-1])"
End With
End Sub

Stan Scott
New York City

"Bryan Kelly" wrote in message
. ..
I need to insert a column in two ways.
First, I need to find a column by searching for the text "AZoriginal",

then
insert a column to the right named "AZ". I will need to add this formula

to
row 2 of that new column

if ( x2 < 0, x2 + 360, x2 )

where x is the column where "AZoriginal" was found. Actually I need to

copy
the formula down to the bottom row but I have another macro that I think I
can use as a template and acomplish that.


Second I need to add a new column to the far right end of the data. Then

I
will insert another formula. Once I see the first and how to add a column
to the far right, I should be able to figure out the rest.

--
Thank you,
Bryan Kelly
Time is the medium we use to express out priorities.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default inserting a column to the right

Hello Stan,
That has a couple of it items I just added to my list of things to remember.
Thank you for your time,
Bryan

"Stan Scott" wrote in message
...
Bryan,

This should work for you:

Sub InsertColumnEnterFormula()
Dim myCell As Range
Set myCell = Cells.Find("AZoriginal")
With myCell
.Offset(, 1).EntireColumn.Insert
.Offset(2 - .Row, 1).FormulaR1C1 =

"=IF(RC[-1]<0,RC[-1]+360,RC[-1])"
End With
End Sub

<snip


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting text in column dependant on another column Dave[_13_] Excel Worksheet Functions 3 December 8th 09 05:25 PM
Inserting a column Diane Goncalves[_2_] Excel Discussion (Misc queries) 1 March 8th 07 10:48 PM
inserting new column newyorkjoy Excel Discussion (Misc queries) 0 March 8th 07 08:22 PM
Inserting row/Column d_kight Excel Discussion (Misc queries) 1 December 11th 06 06:20 PM
Inserting Dashes in a Column cbanks Excel Discussion (Misc queries) 3 February 4th 06 06:12 PM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"