#1   Report Post  
Posted to microsoft.public.excel.misc
stats
 
Posts: n/a
Default macro

using macro, how can i assign list box (having values "yes" or "no" )
to all the fields of column D

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default macro

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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default macro

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   Report Post  
Posted to microsoft.public.excel.misc
stats
 
Posts: n/a
Default macro

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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default macro

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   Report Post  
Posted to microsoft.public.excel.misc
stats
 
Posts: n/a
Default macro

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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default macro

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
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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


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