Hello. I am trying to make a code which hide and unhide a range of cells when I click on a specific cell.
This specific cell have a text and a ascii character (a up arrow when I hide and a down arrow when I unhide)
The code is working just fine. However, i would like to know if there is any way to align the text on the left side of the cell, and the ascii character on the right, to make it look better.
Here is the code I made:
Sub Cell_Click()
Dim country1 As Range
Dim country1_cell As Range
Dim asciiup As String
Dim asciidown As String
Set country1 = Worksheets("PC").Range("country1")
Set country1_cell = Worksheets("sheet1").Range("country1_cell")
asciiup = ChrW(8593)
asciidown = ChrW(8595)
If Range("country1").EntireRow.Hidden = True Then
country1_cell.Value = "Country" & asciiup
Range("country1").EntireRow.Hidden = False
Else
Range("country1").EntireRow.Hidden = True
region1_cell.Value = "Country" & asciidown
End If
Sheet1.Range("A1").Select
End Sub
In sum, I would like to align "Country" on the left. And asciiup/asciidown to the right, on the same cell.
Hope someone can help me!
This specific cell have a text and a ascii character (a up arrow when I hide and a down arrow when I unhide)
The code is working just fine. However, i would like to know if there is any way to align the text on the left side of the cell, and the ascii character on the right, to make it look better.
Here is the code I made:
Sub Cell_Click()
Dim country1 As Range
Dim country1_cell As Range
Dim asciiup As String
Dim asciidown As String
Set country1 = Worksheets("PC").Range("country1")
Set country1_cell = Worksheets("sheet1").Range("country1_cell")
asciiup = ChrW(8593)
asciidown = ChrW(8595)
If Range("country1").EntireRow.Hidden = True Then
country1_cell.Value = "Country" & asciiup
Range("country1").EntireRow.Hidden = False
Else
Range("country1").EntireRow.Hidden = True
region1_cell.Value = "Country" & asciidown
End If
Sheet1.Range("A1").Select
End Sub
In sum, I would like to align "Country" on the left. And asciiup/asciidown to the right, on the same cell.
Hope someone can help me!