Hi all,
registered just to ask this question as its fustrating me. I have some knowledge of how VB works - i did a module on it in college (years ago!) but have forgoten everything. i dont use excel or vb everyday - which is why this question will probs be easy to some people.
I am trying to do a very simple macro button.
I want to be able to click the button and for it to fill in a cell with a colour and a boarder. Also one to delete everything so its a blank 'skeleton' worksheet.
The problem i have is that the code below is looking at cell Q13. I want to be able to manually sellect the cell. Is there code for this or there maybe a different way of writing the code, however ive forgotten all the useful stuff from college.
Sub Projected_Time()
'
' Projected_Time Macro
' Fill cell with grey box
'
' Keyboard Shortcut: Ctrl+d
'
Range("Q13").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984740745262
.PatternTintAndShade = 0
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End Sub
I think making the clear sheet button will be alot easier :D but if someone can help me with the top line of this code i would be very greatful.
Thanks
Bookmarks