Results 1 to 2 of 2
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,329

    Excel output on sheets 3-4

    Hi Guy's can anyone help with this one ?



    The output works ok for Excel sheets 1 and 2 but no data goes onto sheets 3 and 4, same data is meant to output

    Code:
    With xLWB.Worksheets(1).Cells(4, 9) = Me.Client
    .Worksheets(1).Cells(5, 9) = Me.Add1
    .Worksheets(1).Cells(6, 9) = Me.Add2
    .Worksheets(1).Cells(7, 9) = Me.Town
    .Worksheets(1).Cells(8, 9) = Me.PostCode
    .Worksheets(1).Cells(9, 9) = Me.Tel
    .Worksheets(1).Cells(10, 9) = Me.Mobile
    .Worksheets(1).Cells(11, 9) = Me.EMail
    .Worksheets(1).Cells.EntireColumn.HorizontalAlignment = xlLeft
    .Worksheets(2).Cells(2, 9) = Me.Date
    .Worksheets(2).Cells(6, 7) = Me.Client
    .Worksheets(2).Cells(7, 7) = Me.Add1
    .Worksheets(2).Cells(8, 7) = Me.Add2
    .Worksheets(2).Cells(9, 7) = Me.Town
    .Worksheets(2).Cells(10, 7) = Me.PostCode
    .Worksheets(2).Cells.EntireColumn.HorizontalAlignment = xlLeft
    .Worksheets(3).Cells(4, 9) = Me.Client
    .Worksheets(3).Cells(5, 9) = Me.Add1
    .Worksheets(3).Cells(6, 9) = Me.Add2
    .Worksheets(3).Cells(7, 9) = Me.Town
    .Worksheets(3).Cells(8, 9) = Me.PostCode
    .Worksheets(3).Cells(9, 9) = Me.Tel
    .Worksheets(3).Cells(10, 9) = Me.Mobile
    .Worksheets(3).Cells(11, 9) = Me.EMail
    .Worksheets(3).Cells.EntireColumn.HorizontalAlignment = xlLeft
    .Worksheets(4).Cells(2, 6) = Format(Now(), "dd-mmmm-yyyy")
    .Worksheets(4).Cells(4, 6) = Me.Client
    .Worksheets(4).Cells(5, 6) = Me.Add1
    .Worksheets(4).Cells(6, 6) = Me.Add2
    .Worksheets(4).Cells(7, 6) = Me.Town
    .Worksheets(4).Cells(8, 6) = Me.PostCode

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Your WITH is wrong, it may be the:
    With xLWB.Worksheets(1).Cells(4, 9)

    instead use: With xLWB

    then the .Worksheets(xxxxx) should work.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Prnt out large Excel Sheets
    By Lou_Reed in forum Access
    Replies: 1
    Last Post: 12-12-2017, 11:53 AM
  2. Import All Sheets from Excel to Access
    By kestefon in forum Access
    Replies: 4
    Last Post: 02-05-2014, 08:30 PM
  3. Download Excel sheets into contacts
    By magster01 in forum Access
    Replies: 1
    Last Post: 08-19-2011, 09:50 AM
  4. Export to excel different sheets
    By apsf68 in forum Access
    Replies: 2
    Last Post: 07-27-2010, 07:05 AM
  5. Import excel sheets to access.
    By calexandru in forum Import/Export Data
    Replies: 0
    Last Post: 08-19-2009, 09:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums