Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help with macro syntax | Excel Discussion (Misc queries) | |||
Correct syntax for IF, Then in a macro | Excel Worksheet Functions | |||
add button syntax | Excel Programming | |||
Macro syntax - how to find them | Excel Programming | |||
Pause macro, add form button to sheet, continue macro when button clicked! | Excel Programming |