I am looking for vba code filter data to copy and paste in same sheet

santoshloka

Board Regular
Joined
Aug 31, 2017
Messages
125
i am a biginner of vba i need help in coding i trying to get filter data in same sheet please find the attachment below for further verification


Private Sub CommandButton1_Click()
a = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row


For i = 2 To a
If Worksheets("sheet1").Cells(i, 6).Value = "x" Then


Worksheets("Sheet1").Rows(i).Copy
Worksheets("Sheet1").Cells.field = 10
b = Worksheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("sheet1").Activate
End If
Next i
Application.CutCopyMode = False


ThisWorkbook.Worksheets("sheet1").Cells(1, 1).Select
End Sub








Capture.PNG
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
So your new to Vba.

But your showing us a script you wrote or found some place and want us to do what?

You have not said anything about what you want to do.

Except for :"filter data to copy and paste in same sheet"

We need details on what you want to do and then maybe we can help you.

And this is a duplicate posting in this this same Forum. Which is a violation of forum rules:

Your previous posting here:https://www.mrexcel.com/forum/excel...a-code-filter-data-copy-paste-same-sheet.html
 
Last edited:
Upvote 0
iam new to this website also i am trying to upload screenshot but i dont know how to make my screenshot as URL,if there is a way to send attachment also i can do that,i coundnt find the option to attach my file.let me know if there is any way
 
Last edited:
Upvote 0
Iam new to this website also i am trying to upload screenshot but i dont know how to make my screenshot as URL,if there is a way to send attachment also i can do that,i coundnt find the option to attach my file.let me know if there is any way

I Have a Huge data i have done filtering(Alt+HSF) ,those filter data need to modify with some other values, those values are beside the filtered data so i need to replace those valuse in orginal location,only one value is pasting. rest of them need to do manually is there any code to paste all filtered data once.
This si my Intention
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,667
Members
449,462
Latest member
Chislobog

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