Replicating Code!!!

S

stevie_ray

Hi there folks,

I am currently creating a student achievement spreadsheet and I a
using ticks in each cell to state if the student has passed the unit o
not.

I am using a simple VBA code to have any cell, within a specifie
range, ticked upon selecting it. If the cell within the specifie
range, already has a tick, the code will remove it. The trick to th
code is the use of the letter "a" in a cell that has had it's fon
formatted to marlett!!

My code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("C13:AB13")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End Sub

The code I am using presently works only on range C13:AB13 (i.e. on
horizontal row). However, I am looking at coping the formula down th
rows (i.e. C14:AB14, C15:AB15.............)

I have attempted to copy and paste the initial formula and ad
different parameters but to no avail. What am I doing wrong?

Mar
 
D

Dave Peterson

If I understand correctly, you just want to expand the range.

If Not Intersect(Target, Range("C13:AB13")) Is Nothing Then
could become:
If Not Intersect(Target, Range("C13:AB999")) Is Nothing Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top