Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
using macro, how can i assign list box (having values "yes" or "no" )
to all the fields of column D |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Assuming you mean "cells" in your post, where you say "fields".
Do you *need* to perform this via macro? It's certainly very easy to perform the operation once manually, and copy paste it into other fields. If you need to perform this via macro, you could record the manual operation described above. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How about selecting your range and then data|validation.
stats wrote: using macro, how can i assign list box (having values "yes" or "no" ) to all the fields of column D -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is what i am looking
i want to create a macro, as soon as i open the spreadsheet, it should run the macro automatically (which i guess can be done using Auto_Open) the macro should behave as follows 1) if value in column A is of the format 2.2 (integer.integer), then fill the column C of the same row with list box (containing "yes" or "no") 2) if value in column A is of the format 2.2 (integer.integer), and value of column C is "some string" then fill the column C with same value (preserve the data if it already exists) I guess i can't do this manually if i have more than 1000 rows. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you select the whole range, you can do it all at once.
stats wrote: This is what i am looking i want to create a macro, as soon as i open the spreadsheet, it should run the macro automatically (which i guess can be done using Auto_Open) the macro should behave as follows 1) if value in column A is of the format 2.2 (integer.integer), then fill the column C of the same row with list box (containing "yes" or "no") 2) if value in column A is of the format 2.2 (integer.integer), and value of column C is "some string" then fill the column C with same value (preserve the data if it already exists) I guess i can't do this manually if i have more than 1000 rows. -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yeah, but I would liek to create a macro, as you see I have couple of
conditions to be satisfied before assigning.. is this doable using macro??? |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This might help.
Option Explicit Sub auto_open() Dim myRng As Range Dim myCell As Range Set myRng = Worksheets("sheet1").Range("a1:A1000") For Each myCell In myRng.Cells With myCell .Offset(0, 2).Validation.Delete If IsNumeric(.Value) _ And .Text Like "#.#" Then With .Offset(0, 2) .Value = "" With .Validation .Add Type:=xlValidateList, _ AlertStyle:=xlValidAlertStop, _ Operator:=xlBetween, Formula1:="Yes,No" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With End With End If End With Next myCell End Sub stats wrote: Yeah, but I would liek to create a macro, as you see I have couple of conditions to be satisfied before assigning.. is this doable using macro??? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |