Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code: Assign Function(s) to all cells in a column
Posted: Sun Jan 01, 2006 3:07 pm Post subject: Assign Function t every cell in column -------------------------------------------------------------------------------- I have a worksheet with columns A thru O. Row 1 has all my column headings. The rest of the page is blank. All the info that is put in thes columns is from other worksheets. Starting with row 2, every time info is put into this worksheet I wis for it to perform a funtion like this in column O for every new row: =I2-(L2*30)-M2 ----------------------------------------------------------------------- Another question, similar to above. I want to assign this functio everytime info is put in column A. I need this info on the same ro where A was entered, but starting on Row 2 (Row 1 has all colum headings): =LOOKUP(A2,Customers!A:A,Customers!C:C) Any ideas -- cbr ----------------------------------------------------------------------- cbrd's Profile: http://www.excelforum.com/member.php...fo&userid=3000 View this thread: http://www.excelforum.com/showthread.php?threadid=49724 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign Function(s) to all cells in a column
Right click on the sheet tab and select view code. At the top of the module,
In the left dropdown select worksheet and in the right dropdown select Change. Then put your code in that sub Private Sub Worksheet_Change(ByVal Target As Excel.Range) If target.count 1 then exit sub if isempty(target) then exit sub if Target.column = 15 then exit sub ' column O cells(target.row,"O").Formula = "=I" & target.row & _ "-(L" & target.row & "*30)-M" & target.row if Target.column = 1 then application.EnableEvents = False ' adjust "F" to reflect the column where you want the formula cells(Target.row,"F").Formula = "=LOOKUP(A" & _ Target.row & ",Customers!A:A,Customers!C:C)" application.enableEvents = True End if End Sub -- regards, Tom Ogilvy "cbrd" wrote in message ... Posted: Sun Jan 01, 2006 3:07 pm Post subject: Assign Function to every cell in column -------------------------------------------------------------------------- ------ I have a worksheet with columns A thru O. Row 1 has all my column headings. The rest of the page is blank. All the info that is put in these columns is from other worksheets. Starting with row 2, every time info is put into this worksheet I wish for it to perform a funtion like this in column O for every new row: =I2-(L2*30)-M2 ------------------------------------------------------------------------ Another question, similar to above. I want to assign this function everytime info is put in column A. I need this info on the same row where A was entered, but starting on Row 2 (Row 1 has all column headings): =LOOKUP(A2,Customers!A:A,Customers!C:C) Any ideas? -- cbrd ------------------------------------------------------------------------ cbrd's Profile: http://www.excelforum.com/member.php...o&userid=30009 View this thread: http://www.excelforum.com/showthread...hreadid=497244 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code: Assign Function(s) to all cells in a column
Thankyou for the help...much appreciated! -- cbrd ------------------------------------------------------------------------ cbrd's Profile: http://www.excelforum.com/member.php...o&userid=30009 View this thread: http://www.excelforum.com/showthread...hreadid=497244 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assign a code to a range of time | Excel Worksheet Functions | |||
Assign blank cells in a column with a value of 1 for sum purposes | Excel Discussion (Misc queries) | |||
Assign a name to worksheet tabs by code | Excel Programming | |||
Assign code to button | Excel Programming | |||
Assign code to shape | Excel Programming |