Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
David Smithz
 
Posts: n/a
Default Simple question - auto populate cells - dependent on other cell value.

How easy is it to have a cell that has a drop down box in it containing two
values. (e.g. yes / no).

If one value is selected (e.g. yes), the five cells below that cell are auto
populated with a value, if the other value is selected they are blanked so
free text can be added.

I assume this will mean I have to delve into the realm of Macro writing (I
have programmed in VB6 so should be able to get on with syntax / object
model etc) but if I don't then that will be a bonus.

Thanks

David


  #2   Report Post  
Posted to microsoft.public.excel.misc
David Smithz
 
Posts: n/a
Default Simple question - auto populate cells - dependent on other cell value.


Stop the press - I think I've cracked. Found a useful example on Google.
Will update is I find it works.


  #3   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Simple question - auto populate cells - dependent on other cell value.


you could try a worksheet change event, I just recorded this with the
macro recorder then copied and pasted it into the worksheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Union(Range("A1"), Target).Address = Range("A1").Address Then
Range("A2:A6").Select
Selection.FormulaR1C1 = "=IF(R1C1=""Yes"",100,"""")"
Range("A3").Select
ActiveCell.FormulaR1C1 = "=IF(R1C1=""Yes"",200,"""")"
Range("A4").Select
ActiveCell.FormulaR1C1 = "=IF(R1C1=""Yes"",300,"""")"
Range("A5").Select
ActiveCell.FormulaR1C1 = "=IF(R1C1=""Yes"",400,"""")"
Range("A6").Select
ActiveCell.FormulaR1C1 = "=IF(R1C1=""Yes"",500,"""")"
Range("A7").Select


End If
End Sub


--
davesexcel


------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=553012

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
Linking Groups of cells between workbooks vnacj-joe Excel Discussion (Misc queries) 4 June 14th 07 05:18 PM
Populate cell with letters from other cells ERudy Excel Discussion (Misc queries) 3 May 16th 06 05:09 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
Auto populate cells based on 2 cells division. Chance224 Excel Discussion (Misc queries) 0 April 4th 05 09:35 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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