Insert Row In Excel File
-
while i try to insert row by Sheet.Rows.Insert(Shift:=Excel.XlDirection.xlDown) i get error is To prevent possible loss of data, Microsoft Office Excel cannot shift nonblank cells off the worksheet. Try to locate the last nonblank cell by pressing CTRL+END, and delete or clear all in cells between the last cell and the end of your data. Then select cell A1 and save your workbook to reset the last cell used. Or, you can move the data to a new location and try again. so please help me how insert row
Hitesh sojitra
-
while i try to insert row by Sheet.Rows.Insert(Shift:=Excel.XlDirection.xlDown) i get error is To prevent possible loss of data, Microsoft Office Excel cannot shift nonblank cells off the worksheet. Try to locate the last nonblank cell by pressing CTRL+END, and delete or clear all in cells between the last cell and the end of your data. Then select cell A1 and save your workbook to reset the last cell used. Or, you can move the data to a new location and try again. so please help me how insert row
Hitesh sojitra
hitesh sojitra wrote:
while i try to insert row by Sheet.Rows.Insert(Shift:=Excel.XlDirection.xlDown)
This is because you have not selected/told excel where to insert new Row. It should be something like this.
Sheet1.Rows("1:1").Insert Shift:=Excel.XlDirection.xlDown
The code above will add new row before cell A1 so everything in row 1 will move to row 2.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
-
hitesh sojitra wrote:
while i try to insert row by Sheet.Rows.Insert(Shift:=Excel.XlDirection.xlDown)
This is because you have not selected/told excel where to insert new Row. It should be something like this.
Sheet1.Rows("1:1").Insert Shift:=Excel.XlDirection.xlDown
The code above will add new row before cell A1 so everything in row 1 will move to row 2.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
Thanks a lot it's working :)
Hitesh sojitra
-
hitesh sojitra wrote:
while i try to insert row by Sheet.Rows.Insert(Shift:=Excel.XlDirection.xlDown)
This is because you have not selected/told excel where to insert new Row. It should be something like this.
Sheet1.Rows("1:1").Insert Shift:=Excel.XlDirection.xlDown
The code above will add new row before cell A1 so everything in row 1 will move to row 2.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
one more quiry please if i wants insert 3 row after A5 than it is (5:3) ? or any thing else?
Hitesh sojitra
-
one more quiry please if i wants insert 3 row after A5 than it is (5:3) ? or any thing else?
Hitesh sojitra
thanks i got it..............
Hitesh sojitra