Results 1 to 2 of 2

Transfert cell values from file "A" to file "B" skipping columns in file "B".

Threaded View

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    Montreal, Quebec
    MS-Off Ver
    Excel 2016
    Posts
    1

    Smile Transfert cell values from file "A" to file "B" skipping columns in file "B".

    Hello,

    The following code allows me to transfer cell values from the “Data Worksheet” to the Update Worksheet”. It also skips a column after every value entered in the “Update Worksheet”.

    Is there a way to do the same, but instead of transferring from Worksheet to Worksheet, I want it to transfer from one Workbook to another?

    Thank you.

    Sub Jobs_Across()
    Dim X As Long
    '   Set number of spaces to skip in the transpose
    Const SkipValue As Long = 2
    '   Set Source Information Here
    Const SourceSheet As String = "Data"
    Const SourceStartRow As Long = 2
    Const SourceEndRow As Long = 11
    Const SourceColumn As Long = 1        ' Column A
    '   Set Destination Information Here
    Const DestinationSheet As String = "Update"
    Const DestinationStartRow As Long = 1
    Const DestinationColumn As Long = 1  ' Column A
    '   Loop to transpose the Source information to the Destination
    For X = SourceStartRow To SourceEndRow
    Worksheets(DestinationSheet).Cells(DestinationStartRow, _
    DestinationColumn + SkipValue * (X - SourceStartRow)).Value = _
    Worksheets(SourceSheet).Cells(X, SourceColumn).Value
    Next
    End Sub
    Last edited by Leith Ross; 07-16-2009 at 04:58 PM. Reason: Added Code Tags

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