Post by joemaydew » Sat Dec 19, 2015 9:01 pm

I'm hoping someone can help me?

I have recorded the below macro and have assigned to a button on my worksheet. My Macro copies information from the sales sheet and pastes into a creation sheet which is then printed. #

What I want to do is, when the user clicks the button to run the macro I would like to specify which row number is used with an input msgbox or something. In the example below you can see row 72 is being used. Information is then copied from various columns all within row 72.

Is this possible?

Many Thanks

Code: Select all

Sub Macro4()
'
' Macro4 Macro
'

'
    Range("C72").Select
    Selection.Copy
    Sheets("Creation").Select
    Range("B3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Sales").Select
    Range("D72").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Creation").Select
    Range("B10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Sales").Select
    Range("E72").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Creation").Select
    Range("F10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("Sales").Select
    Range("F72:H72").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Creation").Select
    Range("B5").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
End Sub

User avatar
New member

Posts

Joined
Wed May 07, 2014 4:58 pm
Location - Staffordshire, United Kingdom


Post by madimar » Sat Dec 19, 2015 10:46 pm

The easiest way is to store desired value (in your example 72) in a specific fixed cell of your sheets. Then you can easily reference to it in your macro code.

M

Inviato dal mio Find 5 utilizzando Tapatalk

-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------


User avatar
Active Member

Posts

Joined
Thu Sep 24, 2009 6:27 pm

Who is online

Users browsing this forum: No registered users and 59 guests