+ Reply to Thread
Results 1 to 5 of 5

Range.("a4").select not working

  1. #1
    Registered User
    Join Date
    11-28-2007
    Posts
    57

    Range.("a4").select not working

    PROJECT: Workorder Database

    I'm trying to write some code for a simple database and am needing some of your VALUABLE help. I know very little about VBA and will be learning this as I go, please be patient.

    I'd really like to do this in 'baby steps'. Thanks

    I've formatted a spreadsheet for the data to be collected, it looks like a form.
    Just some cells with data, i.e. name, address... (actually several sheets of data)

    I want to take the data from the form and have a button append it to the next empty row of a different sheet (this sheet will be in a different file eventually).

    I think I'll be using some type of automated copy/paste from there (somewhat done, it did work, now doesn't).

    Please remember 'baby steps'.

    If someone already has some code that would be fine, if not then...



    Here's some code I wrote,

    The button was on the 'database' sheet and worked well(?).
    When I cut and pasted the button to my 'form' it stopped working.

    It is giving me an error at 'Go to DB and Selects first empty row' selecting cell a4. I tried skipping that line, it gives me an error on all 'range' lines. I tried the 'activate sheet' but still does not work.



    THANKS IN ADVANCE, Phil


    Please Login or Register  to view this content.



    History

    12/03/07
    ....what statement is used to select the next empty row?

    I've tried the 'end(xldown)' it gives me the last used row.

    .......Used 'activecell.offset' THANKS to marcos
    Phil
    Technician
    City of Clinton, SC
    SCADA, GIS, Utility Billing, Networking
    I'm doing the best I can with the little bit I know.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Try this:
    Please Login or Register  to view this content.
    However, you rarely need to select anything, it's something the macro recorder does a lot. So you could combine with the following line, viz:
    Please Login or Register  to view this content.
    not that I'm sure what the formula is...

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I think your code can be simplified a little:
    Please Login or Register  to view this content.
    Last edited by shg; 12-04-2007 at 03:33 PM.

  4. #4
    Registered User
    Join Date
    11-28-2007
    Posts
    57
    I copied your
    Please Login or Register  to view this content.
    Over my
    Please Login or Register  to view this content.
    Still giving me a 'runtime' error at that spot.


    I'm thinking it has to do with the button being on a different sheet and the other sheet needs to be activated, but I tried that and it still won't work...

    I like the idea of combining the commands, THANKS.

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    I forgot to mention that that line should replace the others, but this is now academic as shg as rewritten your code - I suggest you try that.

+ 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