J
Jeff
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(B79) then CbeRange=B79 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(B1012) then CbeRange=B1012 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(B1315) then CbeRange=B1315 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
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(B79) then CbeRange=B79 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(B1012) then CbeRange=B1012 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(B1315) then CbeRange=B1315 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