Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Macro on Button needs syntax help

Hi, I want to create a macro that runs from a button but I need some help
with the coding. I think I know how to attach it to a button after it's
coded. Here is some code describing what I want to do but much of syntax
needs work. Any help would be greatly appreciated. Thanks

SUB Macro for Button Hint

For All JIndex From B To J
For All IIndex FROM 7 To 15

If Cell(IIndex,JIndex) = SpecialCells(xlCellTypeBlanks) Then

If Cell(JIndex:IIndex) in Range(B7:D9) then CbeRange=B7:D9 else
If Cell(JIndex:IIndex) in Range(E7:G9) then CbeRange=E7:G9 else
If Cell(JIndex:IIndex) in Range(H7:J9) then CbeRange=H7:J9 else
If Cell(JIndex:IIndex) in Range(B10:D12) then CbeRange=B10:D12 else
If Cell(JIndex:IIndex) in Range(E10:G12) then CbeRange=E10:G12 else
If Cell(JIndex:IIndex) in Range(H10:J12) then CbeRange=H10:J12 else
If Cell(JIndex:IIndex) in Range(B13:D15) then CbeRange=B13:D15 else
If Cell(JIndex:IIndex) in Range(E13:G15) then CbeRange=E13:G15 else
If Cell(JIndex:IIndex) in Range(H13:J15) then CbeRange=H13:J15

Ctr=0
For All Tests From 1 To 9
If AND(CountIf($JIndex$7:$JIndex$15,Tests)=0 ,
CountIf($B$IIndex:$J$IIndex,Tests)=0 , CountIf(CbeRange,Tests)=0) Then
Ctr=Ctr+1
Fill=Tests
JIxx = JIndex
IIxx = IIndex
End If
Next Tests

If Ctr=1 Then
Cell(JIxx:IIxx) = Fill
For Cell(JIxx:IIxx) set text color = BLUE
STOP - Exit this sub
End If

End If

Next IIndex
Next JIndex

End Sub


--
Jeff
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
help with macro syntax Steve Excel Discussion (Misc queries) 2 February 10th 09 06:59 PM
Correct syntax for IF, Then in a macro Ken[_2_] Excel Worksheet Functions 5 June 21st 08 06:19 PM
add button syntax Big Al Excel Programming 2 April 30th 05 04:33 AM
Macro syntax - how to find them mike b Excel Programming 1 April 11th 05 06:18 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM


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