+ Reply to Thread
Results 1 to 6 of 6

Prompt Box Macro When Code is Run

  1. #1
    Forum Contributor
    Join Date
    03-07-2009
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    128

    Prompt Box Macro When Code is Run

    PHP Code: 
    Sub Retention()

    Dim UserID As String
    UserID 
    Environ("USERNAME")
     
    Range("' Finance View Summary'!D10:BN34").Copy
    Sheets
    ("Retention").Activate
    RCell 
    Range("a" Rows.Count).End(xlUp).Offset(1).Row
    Cells
    (RCell"A").PasteSpecial Paste:=xlPasteValues
    Cells
    (RCell"A").PasteSpecial Paste:=xlPasteFormats
    Cells
    (RCell"G") = Date
    Cells
    (RCell"F") = UserID
    Cells
    (RCell"H") = Time
     
    End Sub 
    Two things actually
    I do not want to have the offset option, I just want to overwrite, and when it overwrites, display a prompt box that alerts that you are about to overwrite the cells and prompts if you would like to save (the save file would be the same location as the file,same name + current date).


    Thanks for the help.
    Last edited by leviathan86; 06-07-2012 at 11:53 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Prompt Box Macro When Code is Run

    So what is the target cell in the Retention sheet? A2?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    03-07-2009
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: Prompt Box Macro When Code is Run

    Yes exactly

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Prompt Box Macro When Code is Run

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-07-2009
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: Prompt Box Macro When Code is Run

    Perfecto. Any way to add in the save feature? Its a nice to have.. not critical.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Prompt Box Macro When Code is Run

    SaveAs? SaveCopyAs? Path?

    Have you tried anything at all?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1