bsharath
asked on
Excel macro to get selected colums to a new sheet
Hi,
I want a macro to ask me which all colums i need to copy to a new sheet.
A,C,F and so on.Ant the macro copies all data in the rows to a new sheet.
Regards
Sharath
I want a macro to ask me which all colums i need to copy to a new sheet.
A,C,F and so on.Ant the macro copies all data in the rows to a new sheet.
Regards
Sharath
ASKER
Is there a way to give as
A:B:D:G:H
All at the same time.This work make work more easier
A:B:D:G:H
All at the same time.This work make work more easier
ASKER
After 1 colum it creates a new page and for the 2nd time i rin the script it goes again to a new page
I don't know how this can be done with non-contiguous ranges in a macro. I think you have to take the different sets of columns one at a time when copying them from one sheet to another
ASKER
Ok then how can i do to copy colums A,C and J
ASKER
Any help...
Hello bsharath,
When copying the columns to the new sheet, do you wish the data to go in the same column, or just from left to right?
Regards,
Wayne
When copying the columns to the new sheet, do you wish the data to go in the same column, or just from left to right?
Regards,
Wayne
ASKER
I want it to copy the full row left and right.
It needs to start from Colum "A"
It needs to start from Colum "A"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I want to copy to A,B,C
bsharath,
Try the macro I posted.
Wayne
Try the macro I posted.
Wayne
Sub copycols()
Dim colrange As String
colrange = InputBox("Select column letter to be copied. If there are 2 or more adjacent, type colon inbetween eg. for columns C to G, type C:G")
Columns(colrange).Select
Selection.Copy
Sheets.Add
Columns("A:A").Select
ActiveSheet.Paste
End Sub