+ Reply to Thread
Results 1 to 4 of 4

database: Copy data from range excluding blanks plus one cell on another column

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    Brazil
    MS-Off Ver
    O365 Win
    Posts
    63

    database: Copy data from range excluding blanks plus one cell on another column

    Hi, I want to copy data that will be on three columns that may vary depending on the situation, can be between 1 and 13 rows of inputted data. Plus the name of a person taken from a list. There will be two macros, two buttons:

    save/modify sale button will copy the data from sheet sales to db, while looking that if the sales Nr. is the same, it will not add a new row, but modify the rest of the column and save a pdf.
    copy from range excluding blank cell.xls
    new sale will erase the sales data (months, and number of apple boxes), plus take the value of the last contract number and place it on I2

    B2 is the name, will always only be one cell.
    A6 through A 19 can be the months
    B6 through B19 can be the number of apple boxes
    C6 through C19 will be the sales number: Sales number will always be a new number with a simple if macro to make it blank (=IF(A6="","",I2+1))


    I can make it to copy one line only, but I don't know how to copy the range, and to make the PDF name with the last contract number of the sale.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: database: Copy data from range excluding blanks plus one cell on another column

    Why 2 buttons ?

    code can see if a sales number excist or not

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-26-2015
    Location
    Brazil
    MS-Off Ver
    O365 Win
    Posts
    63

    Re: database: Copy data from range excluding blanks plus one cell on another column

    Hi Leo,

    Thank you very much for your help, it seems to be working as intended, amazing!

    I needed these two (actually three) buttons because the original sheet also sends an e-mail to both buyer and seller, plus there may be changes that I need to make after I have pressed the button, and it would then update the database.

    I tried adding your code to my original workbook, but I got a variable error on "lr = .Range("B" & Rows.Count).End(xlUp).Row"

    I've attached the original sheet, also could you maybe explain to me how it works? How do I add new rows, or new cells to be copied? I couldn't quite figure it out

    Thanks again for your help man, I really appreciate it.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-26-2015
    Location
    Brazil
    MS-Off Ver
    O365 Win
    Posts
    63

    Re: database: Copy data from range excluding blanks plus one cell on another column

    I tried modifying my first excel sheet that you also worked on, to the look like the one I want to actually use which I attached before. The one I attached before has some VBA codes that might work on mac only and can perhaps do some errors for you. I have attached it here now, I tried the best I could to copy the data I need to the db, but it didn't work - I don't have the knowledge
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Extract a list from a column - excluding blanks
    By bungaree in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-17-2015, 03:48 AM
  2. [SOLVED] Create a list of uppercase data from a range excluding blanks and errors
    By PAexcel in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-17-2014, 01:32 PM
  3. Macro to copy/paste excluding blanks
    By mmdecarl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2013, 04:50 PM
  4. Transposing column range to row while excluding blanks
    By jkhereford in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2012, 12:33 PM
  5. Copy/Paste range of data excluding certain rows and copy to another workbook
    By HoerbigAdm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2012, 02:51 PM
  6. Scan a Column A (numbers and blanks) and copy its contents WITHOUT BLANKS into Column B
    By bighandsam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 05:16 PM
  7. [SOLVED] Define a range while excluding blanks
    By cowboy713 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2012, 05:47 PM

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