thespardian
Board Regular
- Joined
- Aug 31, 2012
- Messages
- 119
- Office Version
- 2016
- 2013
- Platform
- Windows
Hi there!
I am trying to learn vb. I have to perform three different activities in a worksheet. So i wrote following three macros and combined them. Its working for me. But it not in the form, it should be. Can someone please fabricate it for me?
Here is the link for excel file Increment.xlsm.
Thanks a lot.
I am trying to learn vb. I have to perform three different activities in a worksheet. So i wrote following three macros and combined them. Its working for me. But it not in the form, it should be. Can someone please fabricate it for me?
Here is the link for excel file Increment.xlsm.
Thanks a lot.
VBA Code:
Sub Noting()
With Sheet3
.Range("A1:J7").ClearContents
Rows("1:4").EntireRow.Hidden = True
Sheets("DataBase").Select
Range("NotePara1").Copy 'NotePara1 is a cell range name
Sheets("Draft & OM").Select
Range("A5:J5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End With
'Code for para2
With Sheet3 'Sheet3 = "Draft & OM" Sheet
LastRow = .Range("A9999").End(xlUp).Row
Sheets("DataBase").Activate
Sheets("DataBase").Range("NotePara2").Copy
Sheets("Draft & OM").Activate
Sheets("Draft & OM").Range("A" & LastRow).PasteSpecial xlPasteValues
Application.CutCopyMode = False
End With
'Code for incumbants
With Sheet3
LastRow = .Range("A9999").End(xlUp).Row
With .Shapes("FooterGrp1")
.Visible = msoCFalse ' hide the shape for meant for noting portion
End With
With .Shapes("FooterGrp2")
.Left = Sheet3.Range("A" & LastRow + 5).Left
.Top = Sheet3.Range("A" & LastRow + 5).Top
.Visible = msoCTrue
End With
End With
End Sub