Rows selection

%3CLINGO-SUB%20id%3D%22lingo-sub-2899861%22%20slang%3D%22en-US%22%3ERows%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2899861%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20this%20code%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3ESub%20unhideAll()%0A%20%20%20Dim%20lr%20As%20Integer%0A%20%20%20lr%20%3D%20Cells(Rows.Count%2C%202).End(xlUp).Row%0A%20%20%20%20%20%20ThisWorkbook.Worksheets(%22Kitchen%22).Rows(%222%3A%22%26amp%3Blr).Hidden%20%3D%20False%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20I%20want%20it%20to%20look%20like%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3ESub%20unhideAll()%0A%20%20%20Dim%20lr%20As%20Integer%2C%20a%20As%20Integer%0A%20%20%20lr%20%3D%20Cells(Rows.Count%2C%202).End(xlUp).Row%0A%20%20%20a%20%3D%202%0A%20%20%20%20%20%20ThisWorkbook.Worksheets(%22Kitchen%22).Rows(%22a%3A%22%26amp%3Blr).Hidden%20%3D%20False%0A%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20this%20doesn't%20seem%20to%20work%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20do%20you%20enter%20saved%20integers%20into%20a%20range%20in%20excel%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2899861%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I have this code

 

 

Sub unhideAll()
   Dim lr As Integer
   lr = Cells(Rows.Count, 2).End(xlUp).Row
      ThisWorkbook.Worksheets("Kitchen").Rows("2:"&lr).Hidden = False
End Sub

 

 

 

But I want it to look like this

 

 

Sub unhideAll()
   Dim lr As Integer, a As Integer
   lr = Cells(Rows.Count, 2).End(xlUp).Row
   a = 2
      ThisWorkbook.Worksheets("Kitchen").Rows("a:"&lr).Hidden = False

End Sub

 

 

But this doesn't seem to work

 

How do you enter saved integers into a range in excel?

1 Reply

@rad042 

Sub unhideAll()
Dim lr As Integer, a As Integer
lr = Cells(Rows.Count, 2).End(xlUp).Row
a = 2
ThisWorkbook.Worksheets("Kitchen").Rows(a & ":" & lr).Hidden = False

End Sub

 

Is this what you are looking for?