Multiple worksheet Copy Paste Macro


D

danno-c

I have read all of the posts related to Copy & Paste macros and have not
found anything that answers my question.

I am trying to copy and paste different values within the same macro.

When I record the macro and then run it, the macro does not recognize the
value residing in the current clipboard, it only recognizes the previously
copied value. and I end up pasting the same value each time i run the macro.


I have recorded using relative and non-relative values and get the same
result with either one.

What I am physically doing (and have recorded) is as follows:

My workbook is made up of 3 worksheets: LISTING, DETAIL and SORT

Within the LISTING worksheet, I first locate the cell from which I will copy
the value by using F5 and entering a cell reference, I then copy that value
(Ctrl+C).

Then I move to the DETAIL worksheet (Ctrl+PgDn) to locate the value (that I
just copied from the LISTING worksheet) within the DETAIL worksheet
Open find dialog box (Ctrl+F) then paste the clipboard value into the find
dialog box (Ctrl+V) then Enter to find the value.

After the value is located, I close the search dialog box, highlight several
adjacent cells and copy them.

I then move to the SORT worksheet and past the values copied from the DETAIL
worksheet to the SORT worksheet.

I repeat this process several hundred times to build the SORT worksheet.

I inherited these massive workbooks and this process. I know the workbooks
could have been designed much better, but this is what I have to work with
and would appreciate any advice on how to record a macro to accomplish the
above steps.

I'm hoping this macro can be built by recording the keystrokes because I am
VBA illiterate.

Thanks, Dan

MS Office Professional Edition 2003 SP3
 
Ad

Advertisements

Ad

Advertisements

D

danno-c

Jim,
Sorry I know I should have included the code.

--------------------------------
Sub buildsort()
'
' buildsort Macro
' Macro recorded 9/21/2009 by Dan Connelly
'

'
Selection.Copy
ActiveSheet.Previous.Select
Range("E1").Select
Cells.Find(What:="21511BSS", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -8).Range("A1:I1").Select
ActiveCell.Activate
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Next.Select
ActiveSheet.Next.Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Previous.Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top