LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro: How to search and then paste elsewhere


Hello
I'm trying to use a macro to reformat a spreadsheet automatically.
My ultimate goal is to search for the phrase "Transaction Type" an
copy and paste it over 4 cells to the right.

How can I use a variable in a macro to accomplish this?

I recorded the following macro to trace my steps but how do I make mor
generic in case the field is not in cell B211?

Any help would be appreciated
Thanks Bob

Sub Macro6()
'
' Macro6 Macro
' Macro recorded 10/21/2005 by Robert Belforti
'

'
Columns("B:B").Select
Selection.Find(What:="Transaction Type", After:=ActiveCell
LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns
SearchDirection:= _
xlNext, MatchCase:=False).Activate
Selection.FindNext(After:=ActiveCell).Activate
Range("B211").Select
Selection.Cut
Range("E211").Select
ActiveSheet.Paste
End Su

--
rbelfort
-----------------------------------------------------------------------
rbelforti's Profile: http://www.excelforum.com/member.php...fo&userid=1106
View this thread: http://www.excelforum.com/showthread.php?threadid=47839

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, cut & paste chrisk Excel Worksheet Functions 0 November 22nd 07 03:13 PM
Search, copy and paste help [email protected] Excel Discussion (Misc queries) 0 June 15th 07 02:48 AM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
search/copy/paste macro M Excel Programming 1 December 29th 03 07:26 PM
Search/copy/paste Macro mjwillyone Excel Programming 2 December 27th 03 07:49 AM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"