View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Macro interaction

Sounds a bit like homework but
1. a looping macro would do

Sub columnwidthday()
For Each c In Range("b2:b22")
If Weekday(c) = 1 Or Weekday(c) = 7 Then
'MsgBox c.Address
c.ColumnWidth = 3
Exit For
End If
Next c
End Sub

2.
Sub askforvalue()
Range("b1").Value = InputBox("Enter value for b1")
End Sub
--
Don Guillett
SalesAid Software

"C Brandt" wrote in message
...
Hi all:

I am automating much of the work on my sheets with macros. To date, the
vast
majority of the macros have been created using the Macro Recorder, then
judicious editing. This works well for most of the work but there are
several items that I cannot figure out:



1. I would like to set the width of a column based on the contents of
a
cell in that column. i.e.: If the day-of-the-week cell in the column is a
1
or 7 (Sunday or Saturday), I would like to set the width of that column to
3.

2. I would like the macro to ask the user for information to be
placed
in the sheet.



Please let me know if this is easy to do.

Thanks,

Craig