+ Reply to Thread
Results 1 to 5 of 5

Copy and paste VBA command - anybody help me?

  1. #1
    Registered User
    Join Date
    05-26-2006
    Posts
    3

    Copy and paste VBA command - anybody help me?

    Question 1:

    I have this VBA command that copy (from a database) and paste some numbers into (what I would like to be) an table. Right now I paste these numbers in row 4, column 2, 3, 4 and 5 (that is B4:E4). My problem is: I need a command that makes Excel look in the database, copy data if not blank, and then paste them into the table in row 5, 6 and so on - until there is no more data to copy from the database? In other words, I would like to replicate the command I have, but place the data in the next available row - and do this until there are no more data in the database.

    Question 2:

    Then, I need a command that copy the range name from the database (for example: Excelforum Inc.), which could be found in row 1, and paste it into column 1 (e.g. "A") in the table? Of course, I want this names to be pasted at the correct row, that means the row that the numbers from question 1 are pasted into.

    Kind regards

    xtian

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Xtian,

    Which database are you using?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    05-26-2006
    Posts
    3
    Hello!

    It is an Excel Workbook - let us call it "Database.xls".

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Xtian,

    Can you show me an example of how the data are arranged in Database.xls?

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    05-26-2006
    Posts
    3
    Database.xls (I am not sure, because I do not have the database here right now - it might be the opposite direction --> "A1": Name, "B1" to "E1": Numbers):

    "A1": Exelforum (name)
    "A2": 200
    "A3": 123
    "A4": 34
    "A5":1

    "B1": name02
    "B2": 100
    and so on...

    Therefore I want to copy these numbers until there is no data in the column...

    "A1" equals cell A1...

+ 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