sheets.range and adding cells that are out of the range

  • Thread starter Thread starter Phillips
  • Start date Start date
P

Phillips

Can I add several non sequential cells?

Currently I have

With Sheets("15min").Range("A2:S2")
.Parent.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Resize(1,
18).Value = .Value ' copies data from row 1 down to the bottom

End With

But I also want to add some data to BA and CA of this same row. How can I do
that? When I try to add the data, it creates a new row...
BA = current time
CA = total sales (from Sales worksheet Cell C,5 )



Thanks
Phil
 
Phil,

Try:

Dim myRow As Long

With Sheets("15Min").Range("A2:S2")
myRow = .Parent.Range("A" & Rows.Count).End(xlUp)(2).Row
.Parent.Cells(myRow, 1).Resize(1, 18).Value = .Value
.Parent.Range("BA" & myRow).Value = "Whatever1"
.Parent.Range("CA" & myRow).Value = "Whatever2"
End With

HTH,
Bernie
MS Excel MVP
 
Back
Top