Can anyone please explain to a VB Newbie what a Chr is and when it is used??Also how do I know which numbers to use if selecting a specific colour.To make it easy here's a piece of code that's got me baffled!!
Cells(65, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 9 & "/" & Chr(65 + txtPeriod) & 4
Cells(66, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 10 & "/" & Chr(65 + txtPeriod) & 4
Cells(67, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 19 & "/" & Chr(65 + txtPeriod) & 9
Cells(68, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 20 & "/" & Chr(65 + txtPeriod) & 10
txtPeriod was placed as an argument ByRef(txtPeriod) where period is each month and has a column p1, p2....p12
This bit refers to formulas in specific cells..What does "txtPeriod + 1" and "Chr(65 + txtPeriod)" mean exactly??
Also I ve a colour index code supposedly to colour a certain area on a spreadsheet in excel. a piece of code for you:
Selection.Interior.ColorIndex = 34
How do I know which number fits which colour??
Thanks
Cells(65, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 9 & "/" & Chr(65 + txtPeriod) & 4
Cells(66, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 10 & "/" & Chr(65 + txtPeriod) & 4
Cells(67, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 19 & "/" & Chr(65 + txtPeriod) & 9
Cells(68, txtPeriod + 1).Formula = "=" & Chr(65 + txtPeriod) & 20 & "/" & Chr(65 + txtPeriod) & 10
txtPeriod was placed as an argument ByRef(txtPeriod) where period is each month and has a column p1, p2....p12
This bit refers to formulas in specific cells..What does "txtPeriod + 1" and "Chr(65 + txtPeriod)" mean exactly??
Also I ve a colour index code supposedly to colour a certain area on a spreadsheet in excel. a piece of code for you:
Selection.Interior.ColorIndex = 34
How do I know which number fits which colour??
Thanks