Record on next sheet

PANKAJUTEKAR

Board Regular
Joined
Jun 10, 2011
Messages
79
Dear All,

i have a small query.
the following code i got from Sektor Sir, an excellent solution for me to adding records in row in perticular raange.

A small change i required in this code....some one kindly sugget.

Sub addrecord()
Dim lastRow As Long, arr As Variant
lastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
If lastRow = 1 Then lastRow = 1
'(ROWINDEX, COLINDEX)
arr = Array(Cells(4, 6), Cells(5, 6), Cells(11, 2), Cells(7, 6), Cells(8, 6), Cells(9, 6))
Cells(lastRow, 1).Resize(, 6) = arr
Range("F5,F6,F7,F8,F9,b11").ClearContents

Query 1 -
The above code on sheet4. What i tryed, my records are savings.
ok..it come till now row 30.
Now, the new record goes on sheet 5 and started to save from 2nd row, instead of going 31 row.

Is this possible, Experts?

Query 2 -
Whatever the records are saved, i am talking from the first record that is row 16. That exactly started from 16 only.
How come this possible in above code?
I found that only -
lastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
this is specifies the row start column. but how the save button understand that record should start to save from 16 row onwards?

Can pls anyone explain? This must be understand the expert logic.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,590
Messages
6,179,749
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top