LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Paste 2 arrays to 1 row

I didn't wade through all you code in detail, but let me guess

With Worksheets("Data")
Set NextCell = .Cells(.Rows.count, "A").End(xlUp).Offset(1, 0)
End With
Dim L as Long
L = UBound(vBOD) - LBound(vBOD) + 1
NextCell.Resize(1,L).Value = vBOD
NextCell.offset(0,L).Resize(1, Ubound(vPDC) - Lbound(vPDC) + 1) = vPDC

Assuming they will both fit.

--
Regards,
Tom Ogilvy


"Dale" wrote in message
...
Excellent, It works, Any suggetions on how to paste both arrays on the

same
row, vBOD & vPDC from my old code?

Dale

"Tom Ogilvy" wrote:



With Worksheets("Data")
Set NextCell = .Cells(.Rows.count, "A").End(xlUp).Offset(1, 0)
End With
NextCell.Resize(1,UBound(vBOD) - LBound(vBOD) + 1).Value = vBOD

--
Regards,
Tom Ogilvy




"Dale" wrote:

I'm stumped.

The following code works just fine but is one step beyond what the

macro
recorder could do and I would like to graduate to the next level of
programming in Excel. I have reviewed what is in the news groups and

tried a
few but can't seem to modify the code to work for me. Any suggestions?

Tks.

My code

'goto back to the GetReadyData Workbook

ActiveWindow.ActivateNext
Sheets("Data").Select
vCellAddressCount = 1
vBODC = 1
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select 'Down
vPDC = 1

If vPLCount = 0 Then
For i = 1 To 16 'Pastes all of the Business Office Section
ActiveCell = vBOD(vBODC)
ActiveCell.Offset(0, 1).Range("A1").Select 'Right
vBODC = vBODC + 1
Next i
ActiveCell = "No Parts"
ActiveCell.Offset(0, 1).Range("A1").Select 'Right
vPDC = vPDC + 1

vCurrentRow = ActiveCell.Row 'Inputs NOW() into X+Row()
vCurrentRow = "X" & vCurrentRow
Range(vCurrentRow).Select
ActiveCell = Now()

ActiveCell.Offset(1, 0).Range("A1").Select 'Down
Selection.End(xlToLeft).Select
vBODC = 1

End If

For Z = 1 To vPLCount
For i = 1 To 16 'Pastes all of the Business Office Section
ActiveCell = vBOD(vBODC)
ActiveCell.Offset(0, 1).Range("A1").Select 'Right
vBODC = vBODC + 1
Next i
' vPLICount = vRowCount / 2
For i = 1 To 6 'Pastes all of the Parts Items Section
If vPLICount 0 Then
ActiveCell = vPD(vPDC)
ActiveCell.Offset(0, 1).Range("A1").Select 'Right
vPDC = vPDC + 1
Else
ActiveCell = "No Parts"
ActiveCell.Offset(0, 1).Range("A1").Select 'Right
vPDC = vPDC + 1
End If
Next i

vCurrentRow = ActiveCell.Row 'Inputs NOW() into X+Row()
vCurrentRow = "X" & vCurrentRow
Range(vCurrentRow).Select
ActiveCell = Now()

ActiveCell.Offset(1, 0).Range("A1").Select 'Down
Selection.End(xlToLeft).Select
vBODC = 1
Next Z

Code I found which works but does not paste in a row but rather in a

column

With Worksheets("Data")
Set NextCell = .Cells(.Rows.count, "A").End(xlUp).Offset(1, 0)
End With
NextCell.Resize(UBound(vBOD) - LBound(vBOD) + 1, 1).Value =
Application.Transpose(vBOD)





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"