Selasa, 08 Mei 2012

Re: [ExcelVBA] TextToColumns?

 

Hello,
 
This is but a small part of the code and like I said, I am not sure that it is the cause, but it is part of a web query, then a text to columns:
Symbol = ActiveCell.Value
    Thisurl = "http://download.finance.yahoo.com/d/quotes.csv?s=" & Symbol & "&f=l1va2"
    Set qt = ActiveSheet.QueryTables.Add( _
      Connection:="URL;" & Thisurl, _
      Destination:=Range("C" & ActiveCell.Row))
    With qt
      .RefreshStyle = xlOverwriteCells
      .Refresh BackgroundQuery:=False
    End With
(Above sets up and does the query)
ActiveCell.Offset(0, 2).TextToColumns Destination:=ActiveCell.Offset(0, 2), DataType:=xlDelimited, _
        Comma:=True, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), TrailingMinusNumbers:=True
(Above is the TextToColumns)
 
I do not know what causes the problem, but after the code has run and I am completely out of the file and working on something else, if I use Ctrl+C and Ctrl+V, the paste "cuts" up any formula and pastes it to multiple cells.
 
Thanks,
David
 


________________________________
From: "david.smart@ubs.com" <david.smart@ubs.com>
To: ExcelVBA@yahoogroups.com
Sent: Monday, May 7, 2012 7:50 PM
Subject: RE: [ExcelVBA] TextToColumns?


 

When you do your ctrl-v, Excel will generate a worksheet change event.
If you have one of these coded, then it will need to detect that it
should not run, and return without doing anything.

Without more information about any code you have, we can't look at it
any more closely than this.

Regards, Dave S

________________________________

From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
Behalf Of David
Sent: Tuesday, 8 May 2012 04:40
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] TextToColumns?

Hello Group,

Hope everyone is having a good day.

After run some code, if I simply Ctrl+C something and CTRl+V, the
formula ends up in multple cells.

I am not really certain that it is caused by part of the code performing
a TestToColumns, but seems a likely suspect.

I can not stop this unless I shut Excel down and restart it.

Any Ideas? Can I add a line of code to stop this from happening, maybe
just before exiting the code?

I looked through the parameters, most of which are "False" by default,
but maybe after running the code I would have to set them all again to
False?

I am not at all certain that it is TextToColumns at fault. But I thought
maybe someone else had run into this?

Using V2003.

Thanks,
David

----------

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.

UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar