Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find, Copy and Paste question
Hello
My goal is to copy information from one sheet to another, based upon a name I select. This code does it, but what I would like to do is put the game numbers in the first row and paste the copied information after. I have tried and get an error about the cell is not big enough, and I should select a larger area to paste into. I have tried setting the range, and still get the error, how do I work around this? trying the offset(0,1) gave me the same error. I now put the game number into row twenty six, should I cut that and then insert it into the a row? Thanks, Dim strPlayersName As String 'get the players name strPlayersName = InputBox("Type in a players Name!", "Players SuperStats") Dim intRow As Variant Dim intRowA As Variant Dim strName As String Dim rngcurrent As Range intRowA = 3 For i = 2 To Sheets.Count ' Provides a count of all worksheets Cells.Find(What:=strPlayersName, After:=ActiveCell, LookIn:=xlValues, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate intRow = ActiveCell.Row Rows(intRow).Select Selection.Copy strName = ActiveSheet.Name Windows("Player Stats.xls").Activate Rows(intRowA).Select ActiveSheet.Paste Cells(intRowA, 26).Value = strName With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False '.FontName = "Arial" '.Size = "8" End With Cells(ActiveCell.Row + 1, ActiveCell.Column).Select intRowA = ActiveCell.Row Windows("Canucks 2005 Superstats BU.xls").Activate Sheets(i).Select Cells.FindNext(After:=ActiveCell).Activate Rows(intRow).Select Next -- Peace, Richard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Copy and Paste | New Users to Excel | |||
Find, copy and paste | Excel Discussion (Misc queries) | |||
Help! Find info then copy and paste | Excel Programming | |||
Find, Copy, Paste Into Different Workbooks | Excel Programming |