Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2016, 06:53 PM
BRDas BRDas is offline Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2007
Novice
Prevent XL from reformatting when data copy/pasted
 
Join Date: May 2016
Posts: 4
BRDas is on a distinguished road
Default Prevent XL from reformatting when data copy/pasted

I have a similar problem. I collect data from many sources in the form of an MS Word table. I then copy the tables received from each source onto the clipboard and start an Excel macro that pastes the entire table into a spreadsheet. Other sheets in the Workbook then analyze the data and build scripts for posting the data to a database. Feedback is then sent to the source for confirming the data received. But if they have typed "February 1979" as an answer into a cell in the Word table, what gets stored in Excel is "01-02-1979". And if they have typed "2/79" into the cell, Excel stores it also as "01-02-1979". So there is no way that I know of by which I can automatically send back to the source exactly what they have typed. I can either choose a particular output format and everyone gets it back in that format, or for each form received I have to painstakingly retype the data into the Excel sheet with a single quote mark in front.

Suggestions welcome.


Question related to https://www.msofficeforums.com/excel...doing-any.html

Last edited by Pecoflyer; 05-08-2016 at 11:24 PM. Reason: Add link
Reply With Quote
  #2  
Old 05-08-2016, 11:24 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Hi
please do not hijack other threads. If you have a question, start a thread of your own, and, if necessary, add a link to the thread you found.
I did it for you this time
Cheers
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 05-08-2016, 11:29 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

One possibility is to format the entire destination sheet as "Text".

I think this will preserve all pasted data as is.
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #4  
Old 05-09-2016, 08:22 PM
BRDas BRDas is offline Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2007
Novice
Prevent XL from reformatting when data copy/pasted
 
Join Date: May 2016
Posts: 4
BRDas is on a distinguished road
Default Thanks for your suggestion

That works with typing but not with pasting. You can easily try it yourself. Open a blank worksheet, format one column as General and one column as Text. Type "Feb 79" in a cell in both columns. They are displayed differently. Then type "Feb 79" somewhere else and put it on the clipboard. Paste into both columns. Both columns will show identical date data.

Any other ideas?
Reply With Quote
  #5  
Old 05-09-2016, 11:28 PM
macropod's Avatar
macropod macropod is online now Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,362
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you're going to be analysing data and the dates have any role in that, conversion to a proper date format is more or less unavoidable. Regardless of what the date is in Excel, though, it can be formatted to appear in just about any format you want for pasting into another app. Besides which, why are you 'sending back' anything other than the results of the analysis? It seems pointless to be trying to re-export the data as well.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 05-10-2016, 01:02 AM
BRDas BRDas is offline Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2007
Novice
Prevent XL from reformatting when data copy/pasted
 
Join Date: May 2016
Posts: 4
BRDas is on a distinguished road
Default

Thanks for your suggestion! In this case we are just using the date for historical records purposes, and sometimes all someone remembers is the year and not the month. When they know the month we want to record and display that, and when they only know the year then we want to record and display only that. Thus I just want to capture whatever characters they have typed and store them. I guess it is not possible without retyping into Excel.
Reply With Quote
  #7  
Old 05-10-2016, 01:09 AM
macropod's Avatar
macropod macropod is online now Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,362
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If someone inputs merely a year number, Excel won't convert that to a date, so there's no issue there; it's only where a month is input that Excel might do a conversion - and then always to the 1st of the month if no day is input. Easy enough to handle without re-typing anything.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 05-10-2016, 04:01 AM
BRDas BRDas is offline Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2007
Novice
Prevent XL from reformatting when data copy/pasted
 
Join Date: May 2016
Posts: 4
BRDas is on a distinguished road
Default

Yes, good point, but then how to structure a single formula that will deal with both possibilities and give a meaningful result? ISTEXT will be false for both and ISNUMBER will be true for both. YEAR gives the correct result when applied to the Month and Year combination, but when applied to the single four digit year it treats it as a Julian date and gives "1905". The only thing I could come up with, since none of the dates will be from the early 20th century is the following:

=IF(YEAR(E3)>1950,TEXT(E3,"mmmm") & TEXT(E3,"yyyy"),E3)

That should do it!

Thanks for your help!
Reply With Quote
  #9  
Old 05-10-2016, 01:24 PM
macropod's Avatar
macropod macropod is online now Prevent XL from reformatting when data copy/pasted Windows 7 64bit Prevent XL from reformatting when data copy/pasted Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,362
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you're only interested in the year part, you could use:
=IF(LEN(A3)<5,A3,YEAR(A3))

In a situation where some data have only years and other data have months & years, that would seem to be the most consistent way of analysing them; otherwise you'd need to analyse the data with months & years separately from the data with years only, to avoid skewing the analysis.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Style for Text Changes from Normal to Heading 1 when Copy-Pasted Basia Word 8 08-15-2015 02:32 PM
Prevent XL from reformatting when data copy/pasted Prevent access to raw data in a pivot table? Chancy Excel 3 02-03-2015 11:33 AM
Prevent XL from reformatting when data copy/pasted Conditional Formatting over copied and pasted data kb3264 Excel 6 07-11-2012 07:12 AM
Prevent XL from reformatting when data copy/pasted Stop underlining pasted data LarryStroup PowerPoint 5 01-11-2012 12:47 PM
Prevent XL from reformatting when data copy/pasted Numbered list turns to bullets when copy/pasted cathleenmcguire PowerPoint 6 08-31-2011 08:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft