Hi
I'am trying to do this.
Have a spreedsheet that have some columns like this the table under here
[TABLE="width: 861"]
<tbody>[TR]
[TD][TABLE="class: grid, width: 100%"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]K[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Finished[/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Finished[/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Finished[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Roy[/TD]
[TD]23.4.2018[/TD]
[TD]x[/TD]
[TD][/TD]
[TD]Mette[/TD]
[TD]27.05.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD]Hanne[/TD]
[TD]01.12.2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Mette[/TD]
[TD]27.5.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD]Oskar[/TD]
[TD]30.04.2018[/TD]
[TD]x[/TD]
[TD][/TD]
[TD]Helena[/TD]
[TD]18.07.2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Cecilie[/TD]
[TD]03.3.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Hans[/TD]
[TD]01.02.2018[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Roy[/TD]
[TD]17.5.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I'am trying to get a module in
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
to do a thing. If someone write a x to column C,G or K it will run this code I have writen (that dont work)
But this do not work, I'am also sure that I can write the code so it is not so long?
Hope that someone understand my problem here
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I'am trying to do this.
Have a spreedsheet that have some columns like this the table under here
[TABLE="width: 861"]
<tbody>[TR]
[TD][TABLE="class: grid, width: 100%"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"]J[/TD]
[TD="align: center"]K[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Finished[/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Finished[/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Finished[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Roy[/TD]
[TD]23.4.2018[/TD]
[TD]x[/TD]
[TD][/TD]
[TD]Mette[/TD]
[TD]27.05.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD]Hanne[/TD]
[TD]01.12.2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Mette[/TD]
[TD]27.5.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD]Oskar[/TD]
[TD]30.04.2018[/TD]
[TD]x[/TD]
[TD][/TD]
[TD]Helena[/TD]
[TD]18.07.2018[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Cecilie[/TD]
[TD]03.3.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Hans[/TD]
[TD]01.02.2018[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Roy[/TD]
[TD]17.5.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I'am trying to get a module in
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
to do a thing. If someone write a x to column C,G or K it will run this code I have writen (that dont work)
Code:
Dim lastrowc As String
Dim lastC As String
Dim c As Variant
Dim kollone1 As Variant: kollone1 = 3
Dim kollone2 As Variant: kollone2 = 7
Dim kollone3 As Variant: kollone3 = 11
Dim startRad As String: startRad = 3
lastrowc = Cells(Rows.Count, 1).End(xlUp).Row
'lastC = Cells(1, Columns.Count).End(xlToLeft).Column
Dim col1 As Variant
For c = startRad To lastrowc
For col1 = kollone1 To kollone1
If Cells(c, col1) = "x" Then
Cells(c, col1) = "X"
Cells(c, col1).Select
With Selection.Font
.Name = "Calibri"
.Size = 18
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
End If
Next col1
Dim col2 As Variant
For col2 = kollone2 To kollone2
If Cells(c, col2) = "x" Then
Cells(c, col2) = "X"
Cells(c, col2).Select
With Selection.Font
.Name = "Calibri"
.Size = 18
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
End If
Next col2
Dim col3 As Variant
For col3 = kollone3 To kollone3
If Cells(c, col3) = "x" Then
Cells(c, col3) = "X"
Cells(c, col3).Select
With Selection.Font
.Name = "Calibri"
.Size = 18
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
End If
Next col3
Next c
End Sub
But this do not work, I'am also sure that I can write the code so it is not so long?
Hope that someone understand my problem here
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Last edited: