Macro for copying cells with format from last sheet to new sheet
Closed
gm2612
Posts
11
Registration date
Monday 23 December 2013
Status
Member
Last seen
1 January 2014
-
27 Dec 2013 à 00:17
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 27 Dec 2013 à 23:59
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 27 Dec 2013 à 23:59
Related:
- Macro for copying cells with format from last sheet to new sheet
- How to copy data from one excel sheet to another - Guide
- Little alchemy cheat sheet - Guide
- Create new sheet vba - Guide
- How to copy data to multiple worksheets in Excel - Guide
- Excel hyperlink to another sheet - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
27 Dec 2013 à 23:59
27 Dec 2013 à 23:59
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