Link to home
Start Free TrialLog in
Avatar of npl77
npl77

asked on

Deleting a row in a worksheet using vb.net

I want to delete a certain row in an excel woorksheet.
This code does not work

dim sheet as worksheet
sheet.cells.rows(2).Delete()

nor does this

sheet.Rows.Delete()

what am I doing wrong?
Avatar of bman9111
bman9111

show all the code u are using
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of npl77

ASKER

here is the problem I gotta paste information into an excel sheet full of information. First I must clear the whole current sheet, then add a paste prtion to the sheet what happens is it pastes the information over the other information.

 tempsheet.UsedRange.Select()
                   

                    excelapp.Selection.Copy()
                   'Trying to select the whole currentsheet and clear it then paste what i copied
                    currentsheet.Range(currentsheet.Cells(1, 1), currentsheet.Cells(64, 64)).Select()
                    'currentsheet.Select()
                    currentsheet.Paste(currentsheet.Cells(1, 1))
 
please help me fix this!
When you a cell selected, and you don't clear the selection, the paste will go over the selected cell.

Bob