LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default working by column name


I am trying to write some macros that operate using column headers instead
of column
identifiers such as A, B, etc. At the end of line 7, I should have a range
set to the entire
column that has "AZ slave" in row 1.

Line 8 is supposed to insert a blank column next to the column I just
selected.
This doesn't work. No column is inserted. When I look up
the insert function, the description never says what happens with the new
column.
It seems to be that I sould be able to insert it and attach it to the
variable
AZ_Slave_Mode_Column.
Line 9 is an alternative to 8 that also does not work.

Note: I can not get this stinking Microsoft Outlook to let me paste in text
without double
spacing it. I typed this in and it probably has some typos.


1 Sub Add_Slave_Mode_Columns()
2 Dim this_sheet As Worksheet
3 Dim AZ_Slave_Mode_Column As Range
4 Dim AZ_Slave_Mode_Column As Range
5 Dim AZ_Slave_Value_Column As Range

6 Set this_sheet = Worksheets("data")
7 Set AZ_Slave_Value_Column = Select_Column_By_Name("AZ slave", this_sheet)

8 Set AZ_Slave_Mode_Column = AZ_Slave_Value_Column.Insert(xlToRight)
9 AZ_Slave_Mode_Column =
Worksheets("data").Columns(AZ_Slave_Value_Column). Insert
End Sub


10 Function Select_Column_By_Name(find_target As String, w_s As Worksheet)
As Range
11 Dim caller_range As Range
12 Set caller_range = w_s.Range("A1:AZ1"). _
13 Find(find_target, _
14 Lookat := x1Whole,_
15 LookIn:=x1Values,_
16 MatchCase:=False)
' Extend the range down to the last row.
17 Set caller_range = w_s.Range(caller_range,caller_range.End(x1down))
18 Set Select_Column_By_Name = caller_range
19 End Function

Question: How do I insert a column such that after the insert I have my
range variable
AZ_Slave_Mode_Columnthat points to that column?

Question: Once I have that column, how do I do this:
AZ_Slave_Mode_Column.row_two_formula =
AZ_Mode_Column.row_two_value - Axis_2_Mode_Column.row_two_value.

Obviously the syntax is wrong, but I hope I have expressed the correct
concepts here.

Thank you,
Bryan


 
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
Auto Complete not working in one column Lisa[_6_] Excel Discussion (Misc queries) 3 April 30th 09 04:26 PM
Day of week Fill down column not working Minion Excel Worksheet Functions 4 April 7th 09 04:27 AM
Sort Not Working on Column of Numbers therube Excel Worksheet Functions 4 February 9th 09 01:45 PM
Trying to transpose a row to a column - it is not working - help! MRAWLS Excel Worksheet Functions 4 December 10th 08 03:14 PM
Printing after using column auto fit - not working Caroline Lackey Excel Discussion (Misc queries) 2 June 9th 05 04:50 PM


All times are GMT +1. The time now is 11:16 AM.

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

About Us

"It's about Microsoft Excel"