+ Reply to Thread
Results 1 to 4 of 4

Importing defined columns from selected workbook sheets

  1. #1
    Registered User
    Join Date
    11-24-2005
    Posts
    39

    Importing defined columns from selected workbook sheets

    Greetings again

    I'd like to open a openfile dialog and select a specific workbook, then on Sheet1 of that workbook copy specific column into the current workbook under a newly created sheet name "TESTSHEET"

    I've been working with this code but so far I'm unble to select the specific columns I want and copy them over.

    Question:
    I want to copy Ranges C1:F?, J1:K? where the ? is the last datarow in column D of customerWorkBook.WorkSheets(1) and paste it to Range B1:G? of targetWorkBook("testsheet")?

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-24-2005
    Posts
    39

    Re: Importing defined columns from selected workbook sheets

    Additional question;

    I have 20 checks to make, if true, then insert 2 entire rows.

    I think this should be a While, If Then function, but I'm not sure how to form it.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-24-2005
    Posts
    39

    Re: Importing defined columns from selected workbook sheets

    This portion of thevba code works, but its obviously very bulky

    Any way to clean this up?

    I had to add lastrow=lastrow+1 to account for the extra spaces being inserted or the function stopped at the original lastrow value which left several sections without row spaces.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-24-2005
    Posts
    39

    Re: Importing defined columns from selected workbook sheets

    Still on this bit of code, time to take a break.

    In the vba code section of Sheet1
    partial code,
    Please Login or Register  to view this content.
    I need to pass the variables;
    Please Login or Register  to view this content.
    Over to the "EPB_Template" Sheet to handle the variables there;
    Please Login or Register  to view this content.
    With the sheer amount of repetition, I still cannot find a workable loop to cut this down.

    Any suggestions?

+ 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. Similar Columns in Different Sheets, Importing Data
    By RJA_VB in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-25-2014, 05:23 PM
  2. [SOLVED] Merging selected sheets with selected columns into another sheet
    By harry_1805 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2013, 01:51 PM
  3. Automatically importing sheets from one workbook to another
    By hugedomer11 in forum Excel General
    Replies: 2
    Last Post: 08-05-2011, 04:16 PM
  4. Workbook Defined Name not available to other sheets
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-20-2010, 04:28 PM
  5. Replies: 6
    Last Post: 03-29-2006, 07:50 AM
  6. [SOLVED] How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook?
    By Dmitry in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2006, 07:50 AM
  7. Replies: 6
    Last Post: 03-29-2006, 07:50 AM

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