Hide sheet, filter data, fill formula, select visible cells


To add sheets:

Sheets.Add after:=Sheets(Sheets.count)
----------------------------------------
Sub togetsheenames()
Dim i As Integer
Dim sh As String
For i = 1 To Sheets.Count
sh = Sheets(i).Name
Sheets("ToDelete").Range("A" & i) = sh
Next

End Sub
--------------------------
fill lookup formula 
Range("D3").Select
ActiveCell.Formula = "=VLOOKUP(A3,Exp!$B:$E,4,0)"
    Range("d3").AutoFill Range("d3:d" & Range("a1").End(xlDown).Row)
------------------
Hide sheet

Sheets("Sheet2").Visible = True

unhide sheet 

Sheets("Sheet2").Visible = Flase
---------------------------------------------
For i = 2 To drcount
mystng = Sheets("Counter").Range("A" & i).Value
LR = Sheets("Rough").Range("A1").CurrentRegion.Rows.Count + 1
Sheets(2).Select
Sheets(2).Rows("3:3").AutoFilter Field:=26, Criteria1:=mystng
Sheets(2).Range("A3").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy Sheets("Rough").Range("A" & LR)
Sheets(2).Range("A3").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).Select
Selection.EntireRow.Delete
Sheets(2).AutoFilterMode = False

Comments

Popular posts from this blog

number format

send Mail by outlook from excel sheet

Find and copy the data