Simple Copy-Paste

Boris7265

Board Regular
Joined
Apr 6, 2011
Messages
68
Hi everybody,

I am having a problem and be honest I am stuck with it , therefore any advise will be very helpful and appreciated .
The problem is that I have very large excel file .There 6 columns that is
Name,JSTExpenses, Amount, Date, Court and Current Balance. The management would like now to separate JSTExpenses that called “<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:City w:st="on"><st1:place w:st="on">Alliance</st1:place></st1:City> “ into separated excel file( they would like it is to be new excel worksheet in the sane excel file) . I can do via vb code that I looked up on the forum ( very thanks full for that)but the problem that with every row applied to Alliance second row comes that issued to “JJL Service” that is also name in JST Expenses column so there are two rows and one row in unique and another is not .”JJL Service” is the same for all JSTExpenses column .The problem I need to separated rows and copy them in new worksheet by “Alliance” that I can do and by “JJL service” that is the same for all expenses .The arrangement is in the first initial excel file like this
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
<st1:City w:st="on"><st1:place w:st="on">Alliance</st1:place></st1:City>
JJL
<st1:City w:st="on"><st1:place w:st="on">Alliance</st1:place></st1:City>
JJL
Meditation
JJL
<o:p> </o:p>
Common row in here only Name if the checks <st1:place w:st="on"><st1:City w:st="on">Alliance</st1:City></st1:place> and JJL should be come together.
<o:p> </o:p>
Thank you in advance for any advice or input
<o:p> </o:p>
The Best Regards,
<o:p> </o:p>
BorisGomel
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Boris,

Can you post your code and a small sample of your data please?

Cheers
Colin
 
Upvote 0
Good Morning rs2K,

Here is code that I am working so far, but it is not working .I would like to copy the entire rows from sheet1 with condition “ISU:Issue Summons Fee” that it is in column F and paste them in just new added worksheet. So far I am working on this and no success .When I start to run macro the whole excel file is frozen and I have to close it.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
Dim c As Range<o:p></o:p>
Dim SrchRng<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Set SrchRng = ActiveSheet.Range("Z1", ActiveSheet.Range("Z65536").End(xlUp))<o:p></o:p>
Do<o:p></o:p>
Set c = SrchRng.Find("ISU:Issue Summons Fee", LookIn:=xlValues)<o:p></o:p>
If Not c Is Nothing Then c.EntireRow.Select<o:p></o:p>
Selection.Copy<o:p></o:p>
<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="on">Loop</st1:place> While Not c Is Nothing<o:p></o:p>
<o:p></o:p>
Dim Filename As String<o:p></o:p>
Dim NewSheet As Worksheet<o:p></o:p>
Filename = InputBox("Enter the file name")<o:p></o:p>
Worksheets.Add().Name = Filename<o:p></o:p>
Set NewSheet = ActiveSheet<o:p></o:p>
<o:p> </o:p>
Range("A1").Select<o:p></o:p>
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<o:p></o:p>
:=False, Transpose:=False<o:p></o:p>

<o:p> </o:p>
Thank you in advance for help with the code.
<o:p> </o:p>
The Best Regards.
<o:p> </o:p>
BorisGomel<o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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