Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Assign a code to a range of time Elizabeth Excel Worksheet Functions 15 October 28th 07 06:42 PM
Assign blank cells in a column with a value of 1 for sum purposes andygoon Excel Discussion (Misc queries) 3 February 6th 07 09:59 PM
Assign a name to worksheet tabs by code Kat[_5_] Excel Programming 0 April 9th 04 08:21 PM
Assign code to button Nic[_2_] Excel Programming 3 February 22nd 04 10:49 AM
Assign code to shape Jacob Excel Programming 1 November 4th 03 02:53 PM


All times are GMT +1. The time now is 09:47 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"