Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
In the clipboard I have a number (e.g. 123,40) which I want insert via a VBA-Macro into a special cell. In an other cell there is a SUM-Function which includes also the one where the value was automatically pasted in. Now there is the problem that after pasting the value it doesn't appear in the sum unless I made a double click on the cell. Does anybody have a hint? Best Regards, Nachtigall |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In your code somewhere have you turned off automatic calculation? If so you
will need to turn it back on at the end of your sub. I tried doing this and it worked fine. The calculation was: "B2=SUM(A1:A2)" Cell B2 was not updated until after automatic calculation was turned on. Application.Calculation = xlCalculationManual Range("A1") = ClipboardGetText Application.Calculation = xlCalculationAutomatic Public Function ClipboardGetText() As String ' (works the same as VB6 Clipboard.GetText function) Dim objDataObject As New DataObject objDataObject.GetFromClipboard ClipboardGetText = objDataObject.GetText(1) End Function " wrote: Hi! In the clipboard I have a number (e.g. 123,40) which I want insert via a VBA-Macro into a special cell. In an other cell there is a SUM-Function which includes also the one where the value was automatically pasted in. Now there is the problem that after pasting the value it doesn't appear in the sum unless I made a double click on the cell. Does anybody have a hint? Best Regards, Nachtigall |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you really use VBA (or VisualBasic)?
Because I do not use the "GetFromClipboard"-Expression but "ActiveSheet.Paste". Maybe this could be the error? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I guess I misunderstood how you were pasting. I tried both methods and
discovered they don't exactly work the same. For example, if I copy lines from this post by highlighting and using Ctrl-C, the ActiveSheet.Paste will paste more than just text. It pastes formats, fonts, multiple lines into multiple cells, etc. My method simply pastes text only into one cell, with multiple lines as one text string having embedded CRLF's. But, if I copy and paste a single number into one cell using either method the calculation shows up immediately. I'm not sure what to tell you. I'm still kind of new to Excel and VBA programming. Did you check to see if automatic calculation is turned off somewhere? I need to hit the road. Sorry I couldn't be of more assistance. Have a nice weekend. " wrote: Do you really use VBA (or VisualBasic)? Because I do not use the "GetFromClipboard"-Expression but "ActiveSheet.Paste". Maybe this could be the error? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paste and Paste Special No Longer Working - Excel 2003 | Excel Discussion (Misc queries) | |||
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. | Excel Worksheet Functions | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming | |||
Macro to Paste to specific line, and continue to Paste each time on next row not over | Excel Programming |