Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() on a separate sheet I created a list of items and I named it company, then on the first sheet I created box called company and went to data » validation and chose allow for: list and linked the drop-down to my list of items on the other sheet. -- MarcB ------------------------------------------------------------------------ MarcB's Profile: http://www.excelforum.com/member.php...o&userid=14988 View this thread: http://www.excelforum.com/showthread...hreadid=278300 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am considering that sheet1 is the sheet where you have the list an sheet2 is where the image or text to be displayed according to th selection. I used c1 cell in sheet1 as list box. you need to paste this code at : tools -macro-visual basic editor -on the left corner you will se excel worksheet names , select and double click worksheet name wher the listbox is available, sheet1 according to mine. just copy and paste the below code. Dim t As String Private Sub Worksheet_Change(ByVal Target As Range) Dim pic As Object Dim dat As String Sheets("Sheet1").Select dat = ActiveSheet.Range("C1").Value If dat = "other" Then Sheets("Sheet2").Select ActiveSheet.Range("C6").Select ActiveSheet.Range("C6").Value = "" Set pic = ActiveSheet.Pictures.Insert( _ "C:\Documents and Settings\Administrator\My Documents\M Pictures\test.gif") pic.Width = ActiveSheet.Range("C6").Width pic.Height = ActiveSheet.Range("C6").Height pic.Left = ActiveSheet.Range("C6").Left pic.Top = ActiveSheet.Range("C6").Top t = pic.Name Application.CommandBars("Picture").Visible = False Else Sheets("Sheet2").Select If t < "" Then ActiveSheet.Shapes(t).Select ActiveSheet.Shapes(t).Delete t = "" End If ActiveSheet.Range("C6").Select ActiveSheet.Range("C6").Value = "" ActiveSheet.Range("C6").Value = "any text" End If End Su -- anilsolipura ----------------------------------------------------------------------- anilsolipuram's Profile: http://www.excelforum.com/member.php...fo&userid=1627 View this thread: http://www.excelforum.com/showthread.php?threadid=27830 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lost in code | Excel Discussion (Misc queries) | |||
adding a code to calculate how much time is lost | Excel Discussion (Misc queries) | |||
Please help.. lost in code. | Excel Programming | |||
Please help.. lost in code. | Excel Programming | |||
code lost after saving | Excel Programming |