Hello everyone,
I really couldn't find anything on this in the search, so I really hope I'm not beating a dead horse with this one.
I am trying to create a macro that will automatically copy data from a cell and paste it in a list in another worksheet. Let me explain a bit more;
I am creating a workbook that takes stock prices/highs-lows/change%/etc. for a certain company and assimilating that data into separate worksheets for each category. The stock information is imported directly via "refreshable stock price" feature in excel. So the worksheet this data is imported in is refreshed in the macro and then I manually copy and pasted each entity into it's respective category worksheet. So when you hit the "Update" button it refreshes copy/paste all data over and over again. The problem I am having is that the imported data is supposed to be an absolute reference and the other worksheets that store the data over time should be pasted with relative references to create the list. My VB knowledge is fairly limited and I tried using the "Use Relative References" button by switching it on and off when I am copying and pasting but when I run the macro it is not working. It just pastes the cells over and over.
Here is the macro ( I didn't have time to clean it up so there might be some redundant coding in there) Also I did some formatting stuff at the end that can be ignored I think. Any help will be greatly appreciated.
http://www.mediafire.com/?p2lu94helhd5g4ySub UpdateTest() ' ' UpdateTest Macro ' ' Range("E5").Select Selection.Copy Sheets("Daily Close").Select ActiveCell.Offset(1, 1).Range("B2").Select ActiveSheet.Paste Application.CutCopyMode = False Selection.ClearContents ActiveCell.Select Range("B2").Select Sheets("Company Profiles").Select Range("E5").Select Selection.Copy Sheets("Daily Close").Select ActiveCell.Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("E15").Select Application.CutCopyMode = False Selection.Copy Sheets("Daily Close").Select Range("C2").Select ActiveSheet.Paste Sheets("Daily Close").Select Range("C2").Select Application.CutCopyMode = False Selection.ClearContents Sheets("Company Profiles").Select Selection.Copy Sheets("Daily Close").Select ActiveCell.Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("Q5").Select Application.CutCopyMode = False Selection.Copy Sheets("Shares Out").Select ActiveCell.Offset(1, 1).Range("A1").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("Q15").Select Application.CutCopyMode = False Selection.Copy Sheets("Shares Out").Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("K5").Select Application.CutCopyMode = False Selection.Copy Sheets("Change %").Select Range("B2").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("K15").Select Application.CutCopyMode = False Selection.Copy Sheets("Change %").Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("G5").Select Application.CutCopyMode = False Selection.Copy Sheets("Daily High").Select ActiveCell.Offset(1, 1).Range("A1").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("G15").Select Application.CutCopyMode = False Selection.Copy Sheets("Daily High").Select Range("C2").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("H5").Select Application.CutCopyMode = False Selection.Copy Sheets("Daily Low").Select ActiveCell.Offset(1, 1).Range("A1").Select ActiveSheet.Paste Sheets("Company Profiles").Select Range("H15").Select Application.CutCopyMode = False Selection.Copy Sheets("Daily Low").Select ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Paste Sheets("Daily Close").Select Range("B2:C61").Select Application.CutCopyMode = False Selection.ClearFormats Sheets("Shares Out").Select Range("B2:C61").Select Selection.ClearFormats Selection.NumberFormat = "#,##0" Sheets("Change %").Select Range("B2:C61").Select Selection.ClearFormats Selection.NumberFormat = "0.00%" Sheets("Daily High").Select Range("B2:C61").Select Selection.ClearFormats Sheets("Daily Low").Select Range("B2:C61").Select Selection.ClearFormats Range("A1").Select Sheets("Daily High").Select Range("A1").Select Sheets("Change %").Select Range("A1").Select Sheets("Shares Out").Select Range("A1").Select Sheets("Daily Close").Select Range("A1").Select Sheets("Company Profiles").Select Range("A1").Select Sheets("Control Panel").Select Range("A1").Select
Bookmarks