+ Reply to Thread
Results 1 to 5 of 5

Automating popups in vba

  1. #1
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Automating popups in vba

    Hi,

    I'm running a macro wherein I delimit columns. Excel then asks me if I want to replace the contents of the destination cells. Is there anyway I can automate the process so that the macro selects the "ok" option without asking me for input?

    Thank you all!

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Automating popups in vba

    Hi
    Pls upload sample file...
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Automating popups in vba

    Hey, sorry for the delayed reply!

    Yeah, here is some of the code.

    Sub countSKUs()
    Workbooks(ConsolidatedFile).Activate
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
    Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
    :="-", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
    ActiveSheet.Range("$A$1:$A$20000").RemoveDuplicates Columns:=1, Header:=xlNo
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "=COUNTA(R[1]C[-1]:R[100000]C[-1])"
    Range("B2").Select
    numberSKUsOnline = Range("B1").Value
    thisWorkbook.Activate
    Range("P4").Value = numberSKUsOnline
    Range("J4:L100").Clear
    End Sub

    I'm sorry its ugly, I don't know if there is a better way to paste code here.

    Anyway, when it delimits the columns it asks me if I want to replace the destinations contents, and I want to skip that without having to click "OK". Is there a way to do that?
    Thanks!

  4. #4
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Automating popups in vba

    Hey, managed to work it out, thanks for all the help though!

  5. #5
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Automating popups in vba

    You should be able to achieve that by setting:

    Please Login or Register  to view this content.
    For testing your Regular Expression patterns, try my Regular Expression Pattern Testing add-in!

    For notes on how to use it - see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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