Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default programaticly filling a cell with a formula

hello all...
i have sheet with 6 columns abcdef.
in colum f (row 2)i have the formula =A2&TEXT(B2,"mmm-yy") i use this
for a refrence in another sheet in the book.

im trying to auto fill cell F with the above formula in a given row
after a value in cell A of the same row is entered. Or i guess it would
be nice for som code to combine 2 cell values and place it in cell F.

can anyone nudge me in the propper direction?

thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default programaticly filling a cell with a formula

Why don't we wait until col B is populated? If you already have your formula
in f2 then this will copy it to the row where you entered something in col b

right click sheet tabview codeinsert thissave the workbook.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 2 Then Exit Sub
Cells(2, "f").Copy Cells(Target.Row, "f")
End Sub


--
Don Guillett
SalesAid Software

wrote in message
oups.com...
hello all...
i have sheet with 6 columns abcdef.
in colum f (row 2)i have the formula =A2&TEXT(B2,"mmm-yy") i use this
for a refrence in another sheet in the book.

im trying to auto fill cell F with the above formula in a given row
after a value in cell A of the same row is entered. Or i guess it would
be nice for som code to combine 2 cell values and place it in cell F.

can anyone nudge me in the propper direction?

thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default programaticly filling a cell with a formula

Don, thanks! This is exactly what i was looking for.... i wanted to
do it this way so i didnt have to copy the formula infanatly down the
shet... thanks again!

Don Guillett wrote:
Why don't we wait until col B is populated? If you already have your formula
in f2 then this will copy it to the row where you entered something in col b

right click sheet tabview codeinsert thissave the workbook.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 2 Then Exit Sub
Cells(2, "f").Copy Cells(Target.Row, "f")
End Sub


--
Don Guillett
SalesAid Software

wrote in message
oups.com...
hello all...
i have sheet with 6 columns abcdef.
in colum f (row 2)i have the formula =A2&TEXT(B2,"mmm-yy") i use this
for a refrence in another sheet in the book.

im trying to auto fill cell F with the above formula in a given row
after a value in cell A of the same row is entered. Or i guess it would
be nice for som code to combine 2 cell values and place it in cell F.

can anyone nudge me in the propper direction?

thanks!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default programaticly filling a cell with a formula

Or, without using VBA, just create a formula like =if(LEN(A2&B2)0;
A2&TEXT(B2,"mmm-yy"); "")

That will keep the cell empty when no text exists in cells A2 & B2 ---
just drag the formula down 50 rows and you're good for 50 lines (or use
more if you like).

On 10 jan, 20:05, wrote:
hello all...
i have sheet with 6 columns abcdef.
in colum f (row 2)i have the formula =A2&TEXT(B2,"mmm-yy") i use this
for a refrence in another sheet in the book.

im trying to auto fill cell F with the above formula in a given row
after a value in cell A of the same row is entered. Or i guess it would
be nice for som code to combine 2 cell values and place it in cell F.

can anyone nudge me in the propper direction?

thanks!


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
error when resizing chartarea programaticly TONY Charts and Charting in Excel 1 December 18th 07 03:44 PM
Filling a formula down-need correct cell reference NeedExcelHelp07 Excel Worksheet Functions 13 October 31st 07 06:43 PM
Automatically filling in a formula in a cell Don Excel Discussion (Misc queries) 7 October 22nd 07 09:37 PM
Error '7' Run out of memory while filling in a cell with a formula Jim Cone Excel Programming 2 January 11th 07 03:26 PM
filling information from one cell and filling another. Dianne Excel Worksheet Functions 1 August 15th 05 08:14 PM


All times are GMT +1. The time now is 06:56 PM.

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"