+ Reply to Thread
Results 1 to 13 of 13

Move a range between two workbooks.

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Move a range between two workbooks.

    I have anThat produces the workbook Todays Appointments. In my workbook Therapy Billing 2013 Testing, I have a macro that copies the value in sheet1 B1 Finds that name in clients list and then pastes that row into the Data Sheet. and repeats for each row in column B. I need to get the range B1:B10 From Todays Appointments to the same range in Therapy Billing 2013 Testing Sheet1. I want to create a VBA Macro to do this. Any method that works is fine with me. I would appreciate any and all ideas.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Move a range between two workbooks.

    I suggest to use 2 sheets in the same workbook, not 2 separate workbooks
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    I have an automated workflow that gets information from my calendar and eventually turns it into a text file that contains the text that is in the workbook today's appointments. I have been using an AppleScript action to open that text file into Excel which creates the workbook named today's appointments. Do you know of a way that I could use a macro to open that text file into a new sheet in my workbook therapy billing and I think I would need to have the imported sheet always have the same name when it is imported. If I could do that I wouldn't need two workbooks.

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Move a range between two workbooks.

    yes, I know, but I need a sample of text file

  5. #5
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    Here it is.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Move a range between two workbooks.

    try this code
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    I have put your code into a macro in my therapy billing workbook. I think I have gotten the correct path with Macintosh notation because it did not hang up there. However I do get a compile error "named argument not found" and in the macro text in the VBA editor the words trailing minus numbers is highlighted in blue.Do you know what that means? Does "TrailingMinusNumbers" need to be declared or specified?

  8. #8
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    I also have tried changing "Origin:xlMSDOS," to Origin:xlMacintosh,". I get the same error. and Blue highlight.

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Move a range between two workbooks.

    use macro recorder to open your text file and compare my code with the recording result

  10. #10
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    This is the macro that I got when I recorded importing the text file into my worksheet one of th
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    I was surprised to see that I could simply record a macro that would import that data. Previously I kept getting error messages. Something like data linked to external sources. I'm not sure the differences between the recorded macro in your code. Other than the obvious difference that the recorded macro has a lot more lines of code. While I probably don't have the most elegant solution. I do seem to have some code that combined with my previous thread are creating outcome that I was trying to achieve. mike7952 Gave me some code to take each value in column B that I imported, find a matching row in my client list, and a copy that rolled my client list into the first empty row of my data page which accumulates all my appointments for the year.I have one little loose and left. And I wonder if you could help me with it as well as comment on what I said above.

    The last piece I have is that column B in my data page is the date of the appointment. Somehow when I'm running these make rows today's date is showing up in column B (his code is posted in my previous thread) in column C I have a formula that looks at the value of column B and displays the month that the appointment occurred. I have been doing this process by hand would highlight the formula of the first role of the previous day and drag down a series which would fill in that part of the sheet. It would be nice if I could copy the formula from column C increment the row number by one and pasted it in column C 1 road down, one time for each appointment for the day. This is the formula "=B12-DAY(B12)+1". Thank you for all your help this far.

  12. #12
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Move a range between two workbooks.

    I'm sorry, but you are too verbose and my english is very poor, if you solved the first problem, attach your file with the 2 sheets and add comments to explain the next goal

  13. #13
    Registered User
    Join Date
    03-08-2013
    Location
    Ct, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    25

    Re: Move a range between two workbooks.

    Hello,

    I was away for a bit. I have managed to get this working with your help. I am going to mark this thread closed. Thank you again.

    Michael

+ Reply to Thread

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.6.0 RC 1