A noob is seeking help to combine three macro

thespardian

Board Regular
Joined
Aug 31, 2012
Messages
119
Office Version
  1. 2016
  2. 2013
Platform
  1. 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.
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
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Is this what you need ?
VBA Code:
Option Explicit
Sub Noting()
    Dim LastRow As Long
    Dim msoCFalse As Variant
    'Sheet3 = "Draft & OM" Sheet
    With Sheet3
        .Range("A1:J7").ClearContents
        Rows("1:4").EntireRow.Hidden = True
        Sheets("DataBase").Range("NotePara1").Copy .Range("A5:J5")
        Application.CutCopyMode = False
        'Code for para2
        LastRow = .Range("A9999").End(xlUp).Row
        Sheets("DataBase").Range("NotePara2").Copy
        .Range("A" & LastRow).PasteSpecial xlPasteValues
        Application.CutCopyMode = False
        'Code for incumbants
        .Shapes("FooterGrp1").Visible = msoCFalse ' hide the shape for meant for noting portion
        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
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top