Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Increment array range

Hi,

I just can't get this to work. What I've did is combine code from
here, there and everywhere.
What I want to do is to create an array on 1 worksheet and then paste
the results incrementally on another whilst skipping the blanks.

here is my code:
Sub tester1()

Dim rngArr As Variant
Dim account As String
Dim company As String
Dim debit As Currency
Dim credit As Currency
Dim costcent As String
Dim jrntx As String
Dim tax As String

On Error Resume Next
Dim cell As Range
Sheets("journal").Activate
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set Checkrange = Range("A9:A" & lastRow)
For Each cell In Checkrange
If cell < blank Then
account = cell.Offset(0, 1)
company = cell
debit = cell.Offset(0, 5)
credit = cell.Offset(0, 6)
costcent = cell.Offset(0, 2)
jrntx = cell.Offset(0, 8)
tax = cell.Offset(0, 10)
rngArr = Array(account, company, debit, credit, Null, Null, Null,
costcent, Null, Null, Null, Null, jrntx, tax)

If Sheets("Data Entry Journal").Range("A44") = "" Then
Set Target = Sheets("Data Entry Journal").Range("A44")
ElseIf Sheets("Data Entry Journal").Range("A44") < "" And
Sheets("Data Entry Journal").Range("A45") = "" Then
Set Target = Sheets("Data Entry Journal").Range("A45")
ElseIf Sheets("Data Entry Journal").Range("A44") < ""
And Sheets("Data Entry Journal").Range("A45") < "" Then
Set Target = Sheets("Data Entry
Journal").Range("A44").End(xlDown).Offset(1, 0)
End If

rngArr.Copy Destination:=Target
Application.CutCopyMode = False
End If
Next
End Sub

I think where it falls over is the line rngArr.Copy
Destination:=Target


Many thanks in advance,

Marc
Reply
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
Formula to convert range of time into 1 hour increment Todd Excel Discussion (Misc queries) 5 November 6th 08 07:29 PM
How to fix an array or range delboy Excel Discussion (Misc queries) 1 February 12th 08 08:14 PM
Auto increment chart range montly comfuted Charts and Charting in Excel 1 July 7th 06 10:58 PM
Increment cells only in filtered range? Ed[_18_] Excel Programming 8 June 18th 04 10:44 PM
Range as array Chip Pearson Excel Programming 0 September 10th 03 10:40 PM


All times are GMT +1. The time now is 02:36 AM.

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

About Us

"It's about Microsoft Excel"