Macro for copying cells with format from last sheet to new sheet
Closed
gm2612
Posts
11
Registration date
Monday December 23, 2013
Status
Member
Last seen
January 1, 2014
-
Dec 27, 2013 at 12:17 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Dec 27, 2013 at 11:59 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Dec 27, 2013 at 11:59 PM
Related:
- Macro for copying cells with format from last sheet to new sheet
- Google sheet right to left - Guide
- Windows network commands cheat sheet - Guide
- Mark sheet in excel - Guide
- Little alchemy cheat sheet - Guide
- Excel macro to create new sheet based on value in cells - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Dec 27, 2013 at 11:59 PM
Dec 27, 2013 at 11:59 PM
try this macro modify to suit you
Sub test()
Dim nname As String
With Worksheets("sheet1")
nname = .Range("B5")
If .Range("G1").EntireColumn.Find(what:=nname, lookat:=xlWhole) Is Nothing Then
Worksheets.Add
ActiveSheet.Name = nname
.Cells(Rows.Count, "G").End(xlUp).Offset(1, 0) = nname
ActiveSheet.Move after:=Worksheets(Worksheets.Count)
End If
'suppose the column to be coopied is column D
.Range("D1").EntireColumn.Copy
Worksheets(nname).Range("D1").PasteSpecial xlpasteall
End With
ActiveWorkbook.Save
End Sub