Copy, paste, then sort using VBA

Burrgogi

Active Member
Joined
Nov 3, 2005
Messages
340
Office Version
  1. 2010
Platform
  1. Windows
Every once in a while Fanatical (website) runs a bundle sale. It's listed in this format:

sample sale.png
When I copy & paste this manually into Excel, (Ctrl + C, then Ctrl + V), it looks just fine. See 2nd screenshot. I tried to write up a quick VBA solution to this repetitive process and I've run into a slight problem. The VBA routine tries to cram everything into cell A1 which is incorrect. I'm not versed enough with VBA to correct this problem. Also if someone can help me sort the table from highest to lowest using the Steam user rating column shown in percentage, I'd really appreciate it! EDIT: I know how to sort in Excel, I'm asking how to incorporate that into my current VBA routine.

Here's my code:
VBA Code:
Sub Paste_newSale()
   Sheets("Sheet").Copy , Sheets(Sheets.Count)
   ActiveSheet.Name = Format(Date, "dd_mm_yyyy")
Dim DataObj As MSForms.DataObject
Set DataObj = New MSForms.DataObject
DataObj.GetFromClipboard
SText = DataObj.GetText(1)
ActiveSheet.Range("A2").Value = SText
End Sub

Excel copy_paste_probllem B.png
 
We have a winner ‼ Same player read again post #6 but well this time as never the workbook module was stated​
but the worksheet module …

So each time I want to do the same, I need to insert a new worksheet in my workbook and save your code there? Unless I've misunderstood something, this seems a bit awkward to do.....
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Well read as I never stated each time ! Again the code just must be pasted in the destination / result worksheet.​
Once pasted it will stay in place if only the workbook is saved as macro (.xlsm) or better as binary format (.xlsb) …​
 
Upvote 0
Well read as I never stated each time ! Again the code just must be pasted in the destination / result worksheet.​
Once pasted it will stay in place if only the workbook is saved as macro (.xlsm) or better as binary format (.xlsb) …​

That is not the solution I was looking for but I appreciate your efforts.
 
Upvote 0
Explain at least what you are looking for !​
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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