+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    02-03-2010
    Location
    Ellsworth, Maine
    MS-Off Ver
    Excel 2003
    Posts
    1

    Literal Macro Copying

    Hi all,

    I've recorded a macro which works just fine, except that rather copying contents of a certain cell uniquely, it's pasting the literal value of the macro. In other words, the data being pasted is from an old table, not the current one I'm working with.

    The code is here.
    Code:
    Sub xlsconverter()
    '
    ' xlsconverter Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+Z
    '
        ActiveCell.FormulaR1C1 = "Plot Title: 2235515 "
        Rows("1:1").Select
        Selection.Delete Shift:=xlUp
        Columns("A:A").Select
        Selection.Replace What:="*", Replacement:="2235515", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
        Range("A1").Select
        ActiveCell.FormulaR1C1 = "loggerid"
        Range("B1").Select
        ActiveCell.FormulaR1C1 = "datetime"
        Range("C1").Select
        ActiveCell.FormulaR1C1 = "temp"
        Range("A2").Select
        Columns("B:B").ColumnWidth = 11
        Columns("B:B").ColumnWidth = 13.5
        ActiveWorkbook.SaveAs Filename:= _
            "C:\Documents and Settings\jmckerley\Desktop\temp excel conversions\nso100_2235515.xls" _
            , FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
            ReadOnlyRecommended:=False, CreateBackup:=False
    End Sub
    Clearly, I just need to change the value from, in this case, literally 2235515, but I'm not sure how to do that copy. It's not just copying the value, but I have to briefly edit, with the initial value being "Plot Title = 2235515"

    Thanks in advance!
    -Jacques
    Last edited by Leith Ross; 02-03-2010 at 01:26 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,493

    Re: Literal Macro Copying

    Hello Jacques,

    Welcome to the Forum!

    To make your posts easier to read, copy, and edit please wrap your code. I did it for you this time. Here is how you can do it next time.

    How to wrap your Code using the # icon
    1. Select all your code using the mouse.
    2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.

    To manually wrap your code, use these Bulletin Board Code Tags
    [code] at the start of the first line,
    [/code] at the end of the last line.


    To learn more about BB codes used in this forum, just click on the link below...

    Bulletin Board Codes Tags
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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.2.0