+ Reply to Thread
Results 1 to 25 of 25

Copying from one cell, into the next empty cell in column A in another workbook

  1. #1
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12

    Copying from one cell, into the next empty cell in column A in another workbook

    Can anybody help me do this?

    If its easier.
    I am attempting to create a macro that will copy cell C4 from workbook 'Form' into the next empty cell in column A in workbook 'Master'

    Does that make sense?

    Any suggestions would be brilliant as the one i currently have doesnt work whatsoever

    Regards,

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    This macro copies the value only from A4


    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    Thanks.. But that doesnt really help me considering i need i to copy cell C4 from Wkbk 'Form' in 'Sheet1' and paste into Wkbk 'Master' Sheet 'July 08' in the next empty cell in a specific column.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Just needed to change a couple of things


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    I dont understand.. It says A4..?

    Would it be possible to explain which bit does what..?
    And does this paste it into the next empty cell in column A
    Im not great with VBA if you haven't noticed.
    In future i need to do it with multiple cells but im sure I can figure that out once i know what does what

    Many thanks in advance!

  6. #6
    Registered User
    Join Date
    05-22-2008
    Posts
    74
    Maybe this will help.

    Please Login or Register  to view this content.
    Hope that helps.
    Scott
    The harder it gets the happier I am.
    Finally got my signature set up!

  7. #7
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    I think that im in love with macros. And your macro.
    Haha!

    If that works..
    You truly are a genius.. Seeing as our IT team just told us to click troubleshoot .. Great they are.

    And in advance.. On behalf of my management team.. Thank you. (Only if it works.. Will let you know tomorrow evening after trying it at work)

  8. #8
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    I know its 20 to one and all that.

    But this has been irritating me for weeks.

    Will it matter if i change the data in cell c4 after running the macro?

  9. #9
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    I am getting a Compile Error: Sub or function not defined.???

  10. #10
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Grangey, can you supply a sample workbook? so we can try and replicate your fault as it really should work.
    Not all forums are the same - seek and you shall find

  11. #11
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    It may be that you were getting an error if one of the workbooks was closed as there isn't a workbooks open procedure in there, the code supplied assumes that both workbooks are open!

  12. #12
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    Unfortunately i cant due to data protection.

  13. #13
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    Could it be due to the fact that it is a merged cell c4:e4?

    Forgot to mention that.

  14. #14
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Quote Originally Posted by Grangey
    Unfortunately i cant due to data protection.
    Grangey, a sample workbook does not need your original data, we can work with dummy data but the format of the workbook should be exactly the same!

  15. #15
    Registered User
    Join Date
    04-24-2008
    Location
    Zurich
    Posts
    45
    In the suggested code Workbook("xy") shoud read Workbooks("xy")

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    The part that it is highlighting is the End With bit?

    The strange thing is, my manager claims that this macro is perfectly fine on her computer at home, yet on the work computers it does not work!?

    Any ideas guys?

  17. #17
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    The worksheets/workbooks have to exist else it will fault, when you say it highlights the End With what error does it give?

  18. #18
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    Compile Error: Sub or function not defined

    The workbooks definitely exist, I've had four people check the spelling and everything to ensure im not just being stupid.

    There is a lookup so that only specific words can be entered into the column A but cell C4 contains info that is able to be enterred in there...?

    Also do you need to have Master.xls or just Master?

    It sucks really?
    It doesnt seem to make any sense.

  19. #19
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    Please Login or Register  to view this content.
    If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.

  20. #20
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    Will try that when im next in, thanks

  21. #21
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Quote Originally Posted by colofnature
    Please Login or Register  to view this content.
    It's not a sheet it's a workbook, you may have misread it.

    Are the workbooks that you are trying to use open at the time you run the code as there is no workbooks open statement there?

  22. #22
    Registered User
    Join Date
    04-24-2008
    Location
    Zurich
    Posts
    45
    The strange thing is, my manager claims that this macro is perfectly fine on her computer at home, yet on the work computers it does not work!?

    Any ideas guys?

    The problems may occur because of different settings in the Windows-Explorer (Menue: Extras > Options > show/hide File name extensions).

    You should change the code by including the File extension .xls. Then it should work whatever setting is selected.
    i.e. Workbooks("Master.xls")

  23. #23
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    Quote Originally Posted by Simon Lloyd
    It's not a sheet it's a workbook, you may have misread it.
    Oops, yeah, I did.

    Please Login or Register  to view this content.
    C

  24. #24
    Registered User
    Join Date
    08-01-2008
    Location
    England
    Posts
    12
    When you say windows explorer, what exactly do you mean?

  25. #25
    Registered User
    Join Date
    04-24-2008
    Location
    Zurich
    Posts
    45
    When you say windows explorer, what exactly do you mean?
    Thats the program where you browse directories and files.

    (c:\windows\explorer.exe)

    You can select in options to show or hide file extensions (.xls, .doc, ...) of known file types.
    If option 'show' is selected then in VBA workbooks must be referenced with file name and .xls extension. If option 'hide' is selected then the .xls extension is not required.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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