ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delet certain row in a sheets in workbook (https://www.excelbanter.com/excel-programming/402245-delet-certain-row-sheets-workbook.html)

Arne Hegefors

Delet certain row in a sheets in workbook
 
Hi! I have a big excel workbook with lots of sheets. In most sheets in column
A I have a list of dates. The rest of the columns contains values
corresponding to that date. Now sometimes there is a problem with the numbers
for a certain date. Then I want to be able to delete that particular row (for
that date) in every worksheet. Since there are so many it takes alot of time
to do manually. Does anyone have any idea on how to do this? thanks!

carlo

Delet certain row in a sheets in workbook
 
Hi arne

what do you mean by:
"Now sometimes there is a problem with the numbers for a certain
date."

is the date wrong, or is some other field wrong?

to give you a start for your code:

dim sh_ as worksheet

for each sh_ in activeworkbook.sheets
for i = sh_.cells(65536,1).end(xlup).row to 1 step -1
if sh_.cells(i,1).value = WRONG 'this is the line
'you have to change according to your problem
sh_.rows(i).delete
end if
next i
next sh_

hth

Carlo

On Dec 5, 5:45 pm, Arne Hegefors
wrote:
Hi! I have a big excel workbook with lots of sheets. In most sheets in column
A I have a list of dates. The rest of the columns contains values
corresponding to that date. Now sometimes there is a problem with the numbers
for a certain date. Then I want to be able to delete that particular row (for
that date) in every worksheet. Since there are so many it takes alot of time
to do manually. Does anyone have any idea on how to do this? thanks!




All times are GMT +1. The time now is 09:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com