Remove entire row

Goofan

New Member
Joined
Jul 19, 2011
Messages
17
Hi, I think this question has been asked before here but i couldn't find an "true answer" to the question i possess.

How do you remove an entire row?
my worksheet got 3 coloumns filled with text and with some that got nothing in them however i got 3 other coloumns that are below the others(exampel below). Now i want to remove those rows where there is nothing in them.

Code:
|19919191|1919191191|11116162
|blank|blank|blank
|19919191|1919191191|11116162
|19919191|1919191191|11116162
|blank|blank|blank
|19919191|1919191191|11116162
|19919191|1919191191|11116162
|blank|blank|blank
|19919191|1919191191|11116162
|19919191|1919191191|11116162
|19919191|1919191191|11116162
|blank|blank|blank
|19919191|1919191191|11116162
|19919191|1919191191|11116162
|blank|blank|blank|blank|blank|blank|blank|blank|blank|19919191|1919191191|11116162
|blank|blank|blank|blank|blank|blank|blank|blank|blank|19919191|1919191191|11116162
|blank|blank|blank|blank|blank|blank|blank|blank|blank|19919191|1919191191|11116162
|blank|blank|blank|blank|blank|blank|blank|blank|blank|19919191|1919191191|11116162
I hope this makes some sens atleast :)
And i need it as a function if that makes any diffrence...

Regards,
Thomas
 
Ok i went on google to see how to set a reference to the active workbook and couldn't find what you ment :(
Would you show me an exampel or such?
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Ok i went on google to see how to set a reference to the active workbook and couldn't find what you ment :(
Would you show me an exampel or such?

Dim wbsTarget as WorkBook
Set wbsTarget = Activeworkbook
' Other code here
wbsTarget.Activate
 
Upvote 0
Got any idea of why i cant find the file that i found "yesterday"?
The file is in the same location as the file im using and the name is correct... :O
 
Upvote 0
Ok it seemed like a pritty simple solution, I had to have the entire pathway and all that aswell.
However it sais:
Code:
Run-time error '-2147221080 (800401a8)':
automation error
on this line:

Code:
wksTarget.Range("A3").PasteSpecial Paste:=xlValue
What i get out of that message is that it pastes to much into the new and that i should proberbly not take that many rows and paste over, i get that, but i can't figure out how to actually make that happend.

Code:
Dim wkbSource As Workbook
    Dim wksTarget As Worksheet
    Dim wbsbookTarget As Workbook

    Set wbsbookTarget = ActiveWorkbook
    Set wksTarget = ActiveSheet
    Set wkbSource = Workbooks.Open("C:\xxx\Imported.xlsx")
    wkbSource.Sheets(1).Range("A1:C1000000").Copy
    wksTarget.Range("A3").PasteSpecial Paste:=xlValue
    wkbSource.Activate

I should proberbly only copy the rows that got information in them but how?

Regards,
Thomas
 
Last edited:
Upvote 0
Smitty, thank you so much for the help that you have given.

I managed to figure the rest out and the macro is now working.

Regards,
Thomas
 
Upvote 0
Glad you got it going.

I'm sure you caught it, but logically you need to activate the destination workbook before you can paste into it. ;)
 
Upvote 0
Yea, i finally got it :D I'm just not familiar with vba... been programming in php/as3 and vb 6.0 but never vba so got abit confused and that lead to more misstakes and well i just needed a night good sleep ;)
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,421
Members
452,913
Latest member
JWD210

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