Using a Macro to add a Carriage Return after each data entry within all cells of an imported range of cells

I have a macro that copies data from a Target workbook then pastes the data into a destination workbook.  I then wish to use lookups in the destination workbook to view specific data from the pasted range of data on a separate sheet. 
The problem is, the cells that contain numbers from the pasted data have the green dogeared error flags associated with the cell. The only way I can make a lookup function work, is to go to each cell and manually enter a carriage return after each entry. 
The code for the macro is given below.  What can be done so that the pasted data contains no errors associated with the number cells?  Or can a second macro be written to clean the data.  If so can you help me out?  Thanks in advance.
Kindest Regards
Sub ImportData()
 ' ImportData Macro allows user to select an Excel workbook (i.e. Orchestrate Excel Output),
 ' then copy & paste it into the MediaSpreadsheet.
    Dim wbk As Workbook
    Set wbk = Application.Run("MediaSpreadsheet_1.0.xlsm!OpenFile")
    If wbk Is Nothing Then
        Beep
        Exit Sub
    End If
    Set wbk = ActiveWorkbook
    Range("A9:S116").Copy
    Workbooks("MediaSpreadsheet_1.0.xlsm").Activate
    Sheets("OrchestrateData").Select
    Range("A1").Select
    ActiveSheet.Paste
    With Selection.Font
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
    End With
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    wbk.Close
    Sheets("MediaSchedule").Select
End Sub
DAPulliam64

Hi DAPAugust64,
The green "dogeared error flags" of the cells means that you paste numbers in these cells, but they're formated as Text.
So you need to change the cells back to the correct format so that the lookup function works fine. You can simply call this method after pasting:
ActiveSheet.Cells(1, 1).NumberFormat = "General"
ActiveSheet.Cells(1, 1) = ActiveSheet.Cells(1, 1).Text
Or use PasteSpecial method to paste the numbers as well as it's format:
https://msdn.microsoft.com/en-us/library/office/ff837425.aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Pdfs created on my iMac add hidden carriage returns after each word

    Hello Community,
    This problem exists on my iMac but not my wife's Powerbook.
    Whenever I created a pdf from Preview by printing and then selecting "save as pdf" I got a lovely looking pdf which I could send to anyone and they could view just fine.  However, if I or anyone else selected text from that pdf and pasted it into any other program, it came out with an exclamation point instead of the space between words which is, needless to say, quite undesirable.  Searching around, one thing that was suggested was clearing the font cache so I did this (several times).  It did indeed make a difference:  now instead of exclamation points a carriage return appears after every word!  Once again the pdf looks just fine, but when you copy and paste text from the pdf into any other text program this happens.
    So then I downloaded Adobe Acrobat (the one month fully functional trial program) and made pdfs with this program to see if that was the problem but, no, the same thing occurs.  So it really seems to be a strange glitch in my iMac and my system?
    Any advice would be greatly appreciated.
    Best regards,
    ---Norm

    There is no Flash player version 15... as in your code:
    <param name="swfversion" value="15.0.0.0" />
    For some reason Adobe thought it would be a good idea to target a Flash player version (15) as default.....which may be out a couple years in the future. Go figure!!!
    If you don't like player version 9, change to 10 or 11.... just not 15 (yet).
    Best wishes,
    Adninjastrator

  • How to add a carriage return

    Hi
    How to add a carriage return after Survey Type, so that the Channel Time will start from column one.
    Thanks,
    Steve
    Solved!
    Go to Solution.
    Attachments:
    Write.vi ‏39 KB

    try something like the following draft. (not tested, so modify as needed).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Write-MOD.vi ‏32 KB

  • Pasring multiple fields into the Description field with a carriage return between each in Orchestrator

    I have a Service Request that is entered in through the Self Service Portal.  This service request has 4 different prompts in the Request Offering.
    This will actually eventually become a Change Management Request.
    What I would like to do, is grab the 4 User Inputs, and place them in the Description field of the Change Management Request.  I can get them to show up in the Description, however, I would like to be able to add a carriage return between each User
    Input (along with a description of what's being put in).  How can I do that?
    Right now, it looks like this Username: Name Manager: Manager
    Start Date: Start Date Needs Mail?: Y or N
    I want it to look like this:
    Username: Name
    Manager: Manager
    Start Date: Start Date
    Needs Mail?: Y or N

    Thank you.  This is what I was looking for.
    For those figuring out what to do:
    Add the Run .Net Script command to your Runbook.
    Under Details, selec PowerShell for the Type, and in the Script $Desc = "Username:
    Username field from the Published Data" + "`n" + "Manager: Manager field from the Published Data" + "`n" + "Start Date:
    Start Date field from the Published Data" + "`n" + "Needs Mail:
    Needs Mail field from the Published Data"
    ($Desc is just the variable I used, and can be whatever you want)
    Under Published Data, Add the field you want to output and make the Variable name what you used above without the $
    Then do Update Object and Update the Description with the published data from your PowerShell Command.
    I do this, and my data is passed successfully and it shows up in my notifications, however the carriage returns are not there. It looks the same as it did before I added the powershell right before Update Object. 
    ? Anybody else not getting this to work ? 

  • Add a carriage return in a Unbound String Field

    Post Author: Razzle00
    CA Forum: Formula
    Hi,
         How can I add a carriage return to an unbound string field in a crystal report.  I am using the bundled version of CR with MS Visual Studio 2003 & 2005.  My formula needs to look something like this....
    'Heading One:' + CARRIAGE RETURN + trim({tablename.fld_1}) + CARRIAGE RETURN + 'Heading Two:' + CARRIAGE RETURN  + trim({tablename.fld_2})
    this code all needs to be in 1 unbound string field.  Is this possible?
    Thanks,
    Razzle

    Post Author: SKodidine
    CA Forum: Formula
    To add a carriage return, add CHRW(13)
    For example:
    'Heading One:' & chrw(13) & 'sample text';
    will result in:
    Heading One:
    sample text

  • GREP to Add a Carriage Return at End of Paragraph

    The following search criteria adds a return at the beginning of a paragraph
    Find
    ^.
    Change to:
    ~b$0
    Now I want to instad add a carriage return at the end of the paragraph instead, so I changed my search criteria as shown below, but never get the carriage return. How do I add a carriage return to the end of a pararagh?
    Find
    \z
    Change to:
    ~b

    Peter
    Thanks for your help. I want to create a new, empty paragraph so I can apply a different paragraph style to it than the paragraph style used in the preceding paragraph. Once I have that, I will cut and paste text into the new paragraph that uses the just applied paragraph style.
    Or perhaps more simply, move text that already has a paragraph style applied  to it into a new location, but first have that new location set up with the correct paragraph style so that the formatting is not lost.
    Hope that makes sense.

  • Possible to add the Carriage Return Character

    Hi all,
    I need to add the Carriage Return characters at the end of the each paragraphs.  I found the insertTextAsContent (using: {String | SpecialCharacters} , position: XMLElementPosition), but don't know how to use this function. I think in this method accept only the position as XML Element Object.
    How to use this function to achieve my task?.
    Using: InDesign CS4/Javascript/Windows.
    Regards,
    Karpanai

    you could do: string += "\r";
    \r is a carriage return, and \n is a newline

  • How do I add a carriage return to the output ?

    I have a listBox with 15 values. That list box is connected to a textBox. The text box prints only the selected items from the listBox (thanks try67 for the help getting that set up). Now what I would like to do is have each of the items that are selected to appear seperately in lieu of having one lone continuous line. I think what I need to do is add a carriage returne (or two) between each item selected. Here is the code I have for custom calculation script
    var v = this.getField("DiagnosisList").value;
    if (typeof v=="string") event.value = v;
    else event.value = v.join(", ");
    I triend adding  /r/n   but I keep geting syntax error. Thanks for any assistane.

    I appreciate you assistance, but this is not going to work. The narrative on the listBox for each item is so large, that it either gets chopped off or if I set the text size to auto it is too small. Is there a way to display the list items in a format that 'wraps'? If not then I will neet to set it up with check boxes now, but here is how the format should work:
    () item one
    () item two
    () item three
    then allow certain ones to be checked,
    (x) itme one
    () item two
    (x) item three
    and based on the ones checked, those are the only ones that print
    Item one.
    Item two.

  • Deploying manually CC PKG file built with CC Packager. Not using any third party deployment tool. However after each 5 installations, the PKG files corrupt and cannot be use for a 6th installation. I have to build a new PKG file using CC packager.  Why ?

    Deploying manually CC PKG file built with CC Packager. Not using any third party deployment tool. However after each 5 installations, the PKG files corrupt and cannot be use for a 6th installation. I have to build a new PKG file using CC packager.  Why ?

    http://helpx.adobe.com/creative-cloud/packager.html
    http://forums.adobe.com/community/download_install_setup/creative_suite_enterprise_deploym ent

  • Need to add a carriage return in Paragraph styles

    Hi. I am in a muddle. I have a large amount of data from an xml source. I need to quickly add carriage returns appropriately throughout it so that the paragraph styles can be differentiated.I am using tags manually mapped to styles to do this.
    In order to carriage returns am I right in thinking that I can add a GREP style to each para style, and that it will sense the end of the para through the end marker position of each tag? If this is so, what would the GREP expressionlook like to that I can automate locating the end of a tag/para style so that I can add ~b to it?
    Gratefully!

    Hi @chantal_diva arts,
    It seems to be difficult, because you have much more invinsible character than only the xml markers in your document.
    I think one good way could be @obi-wan Kenobis way.
    Perhaps you can upload an example idml on a file hoster of your choise (e.g. xup.in).
    Regardless, you can try the following:
    1. text search:
    <FEFF>
    replace with:
    2. grep search:
    (?<=\b##)(.)
    replace with:
    \r$1
    3. clean document
    grep search:
    #+
    replace with:
    (nothing)  an empty replace field
    Have fun

  • Add a carriage return in a .csv file

    I running the following command which works but I would like to format the output in the CSV file. The "SecondaryAddresses" field is where my issue is. The field contains multiple addresses as such:
    {[email protected], [email protected], [email protected]}
    Current output in .csv file.
    Desired output in .csv file.
    I want to be able to add a return into the .csv file so the data is in one cell.
    Get-Mailbox jblake -DomainController "DC01" -ResultSize Unlimited | Select-Object DisplayName,alias,PrimarySmtpAddress, @{Name=“SecondaryAddresses”;Expression={$_.EmailAddresses | Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object
    {$_.SmtpAddress}}}
    Chris

    I think that is still not quite there, it is missing the filter on PrefixString.
    Get-Mailbox jblake -DomainController "DC01" -ResultSize Unlimited | Select-Object DisplayName,alias,PrimarySmtpAddress, @{Name=“SecondaryAddresses”;Expression={($_.EmailAddresses | Where-Object {$_.PrefixString -ceq "smtp"}).SmtpAddress -join "`n"}}
    Enclosing $_.EmailAddresses | Where-Object {$_.PrefixString -ceq "smtp"} in parenthesis lets us use the dot operator on the array that it returns. Accessing a property on an array that is actually a property on each of the objects in the array
    should return an array of those property values (an array of SmtpAddresses), which we can then -join with the newline character. Note that this feature of arrays was added in v3.0 so in case you're on an older version this wouldn't work.
    I also don't have the Exchange cmdlets, so I unfortunately I cannot test it either.

  • Removing the carriage return / Tab during data extraction

    Hi ,
      I have an issue with removing the carriage return / Tab from the extracted (Flat File) data from SAP EKPO table.
      1) While uploading(Long Back) the Legacy data to SAP tables the carriage returns and Tabs in Product description were uploaded to SAP tables.
      2) Now I am extracting data from bkpf,..EKPO.. tables  to a flat file . 
    3) When I extract the data i. PO number, Product description,......
    The Product description is going to 3 to 5 lines depending on the carriage returns and Tabs in the Product description.  Ekpo-txz01
    Ex : Mfg # DS104NA / NET######GEAR DS104 Hub######model
        I want  this product description in one continuous line. It is possible only  by removing the Carriage returns and tabs from product description before concatenating and TRANSFERING the file to Server.
    4) What is  getting:  The line is breaking @gear @ Hub due to Carriage return/Tab
    Mfg  D  NET
    GEAR DS104 Hub
    model   .
    5) What is required is: in one line
    Mfg  D  NETGEAR DS104 model
    In the process I am extracting product description from Ekpo-txz01 . So it is internal table. Now I want to remove the carriage return / Tab .
    How these can be removed.
    Thanks,
    Vasu

    Dear Vasu,
    Sometimes there is a problem that cannot be solved normally. This is one of them.
    The reason why the mentioned methods do not work is because you need to remove actually two characters CR and LF in one stroke. You can identify one but then not the other. So approach it from the other side.
    Simply define what your correct characters might be AND only use them to export.
    Below you will find a FORM routine that does just that (only passes defined valid characters and NOT others).
    FORM validate_field USING    VALUE(field_in)
                        CHANGING field_out.
    CONSTANTS:
    All low caps characters
      validlow(26)  TYPE c VALUE 'abcdefghijklmnopqrstuvwxyz',
    All upper caps characters and all figures
      validhigh(36) TYPE c VALUE '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    All other characters (starting with space)
      validrest(32) TYPE c VALUE ' <,>.?/:;"{[}]|\~`!@#$%^&*()_-+=',
    Single quote
      validquote           VALUE ''''.
      DATA:
        pos(1) TYPE c,         " Container to hold 1 character
        l      TYPE i,         " Length
        i      TYPE i.         " Indexer
    Determine length
      l = STRLEN( field_in ).
    Stripping loop
      WHILE i LT l.
      Get one character 
        pos = field_in+i(1).
      Check its validity
        IF pos CO validlow
        OR pos CO validhigh
        OR pos CO validrest
        OR pos EQ validquote.
        When valid, use it
          concatenate field_out
                      pos
                 into field_out.
        ENDIF.
      ENDWHILE.
    ENDFORM.
    Hopes this helps solving your problem.
    Regards,
    Rob.

  • CR2008 exports to editable word -- carriage return on each line

    Hi,
    I exported a CR2008 report to "editable" WORD format.  However, we found there is a "carriage return"(CR)  at the end of each line which is not expected in a paragraph, is this the normal behavior of Crystal Report, is there a workaround ?
    Any idea and suggestion is appreciated. Thanks.
    Regards,
    Gloria

    Hi Gloria
    Can you please update us with the following information:
    What is the database that you are using and its version?
    What is the field type?(String,memo,..etc.)
    Have you installed Service Pack 1 for Crystal Reports 2008?
    Regards
    Ashwini Yadav

  • Can I generate a CR (Carriage Return) in a dynpro entry field ?

    My problem is the following
    I have a card reader and the information of this card will go into a SAP dynpro entry field.
    Now I need an addition CR (Carriage Return)
    Is that possible ?
    Thanks

    Basically this card reader is nothing more than any other barcode scanning or otherwise, so here is what I'm thinking.  At my old company, we had a bunch of barcode scanners which connected directly with SAP, the user would scan the barcode and it would put the value directly in the dynpro field.  This was great, but the user had to then hit enter.  There was no way for us to control this on the ABAP side.  We then discovered that in the barcode reader itself, there is some configuration around what is called a "postamble".  This is a keystroke which is fired automatically when a barcode is scanned, or maybe when a card is swiped?  Check your terminal and see if their is such a setting or configuration.
    Regards,
    Rich Heilman

  • Malicious TornTV add-on continously returning after being disabled- How do I fix this?

    I've been having issues with an add-on to my browser by TornTV that continuously returns after being disabled via the link provided on the ads it invasively opens and via the Add-on Toolbar. I've done the process many times and even sent a formal request to the TornTV website to stop after discovering I cannot remove it permanently only to receive no answer or conclusion.
    It wouldn't be such a big issue were these ads not slowing my browser considerably, crashing it entirely, or generally getting under foot while I'm doing work on the internet; I was just hoping that you might perhaps have a solution to this issue.
    Thank you very much!

    hello, please try to run a full scan of your system with different security tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] and [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] which are specialised in removing adware and browser hijackers.
    [[Troubleshoot Firefox issues caused by malware]]

Maybe you are looking for

  • Access Privileges Button does not bring up pop-up Menu -- SOLUTION

    Hi. I was puzzling for a long time over why my Access Privileges Button did not work under System Preferences // Sharing on the Apple Remote Desktop Panel. I tried re-installing the Remote Desktop Bundle, removing System caches and so forth but nothi

  • Unable to call a BPEL Process from ESB

    Has anyone worked on Oracle ESB ? I've implemented an ESB Scenario where, based on some value, either it should call one BPEL process otherwise it should call another BPEL Process. But, Routing Service is unable to call either of the service. Can any

  • Error when opening t-code

    Hi,   while i am trying to open Transaction RSA1, i am geting the error "Destination is not supported" . Message No RSBO102. Can anybody please guide me, what is the problem? Thanks Dep

  • Actionscript and HBox padding

    How do you set the padding values of an HBox in Actionscript? Can somebody explain why components have certain properties when using MXML and different properties when using Actionscript? This is does not make sense to me. For example when using an H

  • Error when opening workflow

    I get the following error message when I try to open a workflow using the WLI studio. A window pops up and in it is displayed the following error message, The server was unable to complete your request SAXException: The definition was created with a