D
dii jii
Hi,
I have a macro that does some kind of comp..task. Now I would like add
a piece of code that deletes certain column's before the maco creates
the final worksheet..
Ex. Delete Column B,C,M,AA etc. ( My headrsalways start row 23)..
We tried this way..But cannot connect the existing code...
Sheets("tab one").Select
Range("D42").Select
Sheets("custom").Select
Selection.AutoFilter
Range("B23:B400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.ScrollRow = 249
ActiveWindow.ScrollRow = 250
ActiveWindow.ScrollRow = 251
ActiveWindow.ScrollRow = 252
ActiveWindow.ScrollRow = 253
ActiveWindow.ScrollRow = 255
ActiveWindow.ScrollRow = 257
ActiveWindow.ScrollRow = 260
ActiveWindow.ScrollRow = 261
ActiveWindow.ScrollRow = 263
ActiveWindow.ScrollRow = 265
ActiveWindow.ScrollRow = 267
ActiveWindow.ScrollRow = 269
ActiveWindow.ScrollRow = 270
ActiveWindow.ScrollRow = 272
ActiveWindow.ScrollRow = 273
ActiveWindow.ScrollRow = 275
ActiveWindow.ScrollRow = 276
ActiveWindow.ScrollRow = 277
ActiveWindow.ScrollRow = 279
ActiveWindow.ScrollRow = 280
ActiveWindow.ScrollRow = 282
ActiveWindow.ScrollRow = 283
ActiveWindow.ScrollRow = 284
ActiveWindow.ScrollRow = 285
ActiveWindow.ScrollRow = 286
ActiveWindow.ScrollRow = 287
ActiveWindow.ScrollRow = 288
ActiveWindow.ScrollRow = 289
ActiveWindow.ScrollRow = 290
ActiveWindow.ScrollRow = 291
ActiveWindow.ScrollRow = 292
ActiveWindow.ScrollRow = 294
ActiveWindow.ScrollRow = 295
ActiveWindow.ScrollRow = 296
ActiveWindow.ScrollRow = 298
ActiveWindow.ScrollRow = 299
ActiveWindow.ScrollRow = 301
ActiveWindow.ScrollRow = 302
ActiveWindow.ScrollRow = 304
ActiveWindow.ScrollRow = 306
ActiveWindow.ScrollRow = 308
ActiveWindow.ScrollRow = 310
ActiveWindow.ScrollRow = 312
ActiveWindow.ScrollRow = 315
ActiveWindow.ScrollRow = 318
ActiveWindow.ScrollRow = 321
ActiveWindow.ScrollRow = 323
ActiveWindow.ScrollRow = 327
ActiveWindow.ScrollRow = 330
ActiveWindow.ScrollRow = 333
ActiveWindow.ScrollRow = 336
ActiveWindow.ScrollRow = 338
ActiveWindow.ScrollRow = 340
ActiveWindow.ScrollRow = 342
ActiveWindow.ScrollRow = 343
ActiveWindow.ScrollRow = 344
ActiveWindow.ScrollRow = 346
ActiveWindow.ScrollRow = 347
ActiveWindow.ScrollRow = 348
ActiveWindow.ScrollRow = 349
ActiveWindow.ScrollRow = 350
ActiveWindow.ScrollRow = 353
ActiveWindow.ScrollRow = 355
ActiveWindow.ScrollRow = 358
ActiveWindow.ScrollRow = 359
Selection.Delete Shift:=xlToLeft
Range("C23:C400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=3
Range("M23:M400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=9
Range("P23:T400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=9
ActiveWindow.ScrollColumn = 21
ActiveWindow.ScrollColumn = 20
ActiveWindow.ScrollColumn = 19
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("final tab").Select
End Sub
I have a macro that does some kind of comp..task. Now I would like add
a piece of code that deletes certain column's before the maco creates
the final worksheet..
Ex. Delete Column B,C,M,AA etc. ( My headrsalways start row 23)..
We tried this way..But cannot connect the existing code...
Sheets("tab one").Select
Range("D42").Select
Sheets("custom").Select
Selection.AutoFilter
Range("B23:B400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.ScrollRow = 249
ActiveWindow.ScrollRow = 250
ActiveWindow.ScrollRow = 251
ActiveWindow.ScrollRow = 252
ActiveWindow.ScrollRow = 253
ActiveWindow.ScrollRow = 255
ActiveWindow.ScrollRow = 257
ActiveWindow.ScrollRow = 260
ActiveWindow.ScrollRow = 261
ActiveWindow.ScrollRow = 263
ActiveWindow.ScrollRow = 265
ActiveWindow.ScrollRow = 267
ActiveWindow.ScrollRow = 269
ActiveWindow.ScrollRow = 270
ActiveWindow.ScrollRow = 272
ActiveWindow.ScrollRow = 273
ActiveWindow.ScrollRow = 275
ActiveWindow.ScrollRow = 276
ActiveWindow.ScrollRow = 277
ActiveWindow.ScrollRow = 279
ActiveWindow.ScrollRow = 280
ActiveWindow.ScrollRow = 282
ActiveWindow.ScrollRow = 283
ActiveWindow.ScrollRow = 284
ActiveWindow.ScrollRow = 285
ActiveWindow.ScrollRow = 286
ActiveWindow.ScrollRow = 287
ActiveWindow.ScrollRow = 288
ActiveWindow.ScrollRow = 289
ActiveWindow.ScrollRow = 290
ActiveWindow.ScrollRow = 291
ActiveWindow.ScrollRow = 292
ActiveWindow.ScrollRow = 294
ActiveWindow.ScrollRow = 295
ActiveWindow.ScrollRow = 296
ActiveWindow.ScrollRow = 298
ActiveWindow.ScrollRow = 299
ActiveWindow.ScrollRow = 301
ActiveWindow.ScrollRow = 302
ActiveWindow.ScrollRow = 304
ActiveWindow.ScrollRow = 306
ActiveWindow.ScrollRow = 308
ActiveWindow.ScrollRow = 310
ActiveWindow.ScrollRow = 312
ActiveWindow.ScrollRow = 315
ActiveWindow.ScrollRow = 318
ActiveWindow.ScrollRow = 321
ActiveWindow.ScrollRow = 323
ActiveWindow.ScrollRow = 327
ActiveWindow.ScrollRow = 330
ActiveWindow.ScrollRow = 333
ActiveWindow.ScrollRow = 336
ActiveWindow.ScrollRow = 338
ActiveWindow.ScrollRow = 340
ActiveWindow.ScrollRow = 342
ActiveWindow.ScrollRow = 343
ActiveWindow.ScrollRow = 344
ActiveWindow.ScrollRow = 346
ActiveWindow.ScrollRow = 347
ActiveWindow.ScrollRow = 348
ActiveWindow.ScrollRow = 349
ActiveWindow.ScrollRow = 350
ActiveWindow.ScrollRow = 353
ActiveWindow.ScrollRow = 355
ActiveWindow.ScrollRow = 358
ActiveWindow.ScrollRow = 359
Selection.Delete Shift:=xlToLeft
Range("C23:C400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=3
Range("M23:M400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=9
Range("P23:T400").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=9
ActiveWindow.ScrollColumn = 21
ActiveWindow.ScrollColumn = 20
ActiveWindow.ScrollColumn = 19
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("final tab").Select
End Sub