Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default How Macro Ask for Variable Input?

Have the following macro code I run on a spreadsheet. Would like the macro
to prompt the user for a variable input where I have "<8" below. Can this
be done?

Cells.Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=NOW()-$P1<8"
With Selection.FormatConditions(1).Interior
.ColorIndex = 37
.Pattern = xlSolid
End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How Macro Ask for Variable Input?

You've got one reply to your other post.


Al Franz wrote:

Have the following macro code I run on a spreadsheet. Would like the macro
to prompt the user for a variable input where I have "<8" below. Can this
be done?

Cells.Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=NOW()-$P1<8"
With Selection.FormatConditions(1).Interior
.ColorIndex = 37
.Pattern = xlSolid
End With


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default How Macro Ask for Variable Input?

Something like

With Cells
.FormatConditions.Delete
ans = Inputbox("Supply limit (1-10)"
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=NOW()-$P1<" & ans
With .FormatConditions(1).Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
End With

--
HTH

Bob Phillips

"Al Franz" wrote in message
...
Have the following macro code I run on a spreadsheet. Would like the

macro
to prompt the user for a variable input where I have "<8" below. Can this
be done?

Cells.Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=NOW()-$P1<8"
With Selection.FormatConditions(1).Interior
.ColorIndex = 37
.Pattern = xlSolid
End With




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
Variable sum from defined input David Excel Worksheet Functions 7 March 10th 09 06:26 AM
PAUSE EXCEL MACRO FOR INPUT OF DATA VARIABLE lynne b Excel Discussion (Misc queries) 3 September 11th 06 03:37 PM
With QUERY how to input a variable Guillaume Excel Discussion (Misc queries) 1 December 8th 05 02:28 PM
variable/Input box problem [email protected] Excel Programming 2 April 13th 05 01:31 PM
Input box with variable buggy Excel Programming 2 November 19th 04 03:11 PM


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"