Coulmn Fields delete.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code were i am copy data from sheet1 to sheet2 with help of advance
filter. but after advance filter i want to delete some of the columns from
sheet2 (i.e. from report) But it's depend on the report want so is there any
way that what ever fields i have it will display on dialog box and i mark
that column fields which i want to delete from the report sheet and it will
delete that column from sheet.

Is this is possible any help thanks in advance.

Code is .....

Sub Reins()
Sheets("Sheet2").Select

Columns("a:az").Select
Selection.Delete

Sheets("Sheet2").Select
Sheets("Sheet1").Range("A4:AL26").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Sheet1").Range("A1:AL2"),
CopyToRange:=Range("A1"), _
Unique:=False
End Sub

Shital Shah
 
shital shah:
way that what ever fields i have it will display on dialog box and i mark
that column fields which i want to delete from the report sheet and it will
delete that column from sheet.

try,

Dim rng As Range
Set rng = Application.InputBox(prompt:="Please Select Range", Type:=8)
rng.EntireColumn.Delete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top