View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
SherryW SherryW is offline
external usenet poster
 
Posts: 4
Default Newbie needs assistance with VBA code

Don,

I did as suggested and recorded the macro

steps taken when recording the macro we

select the status column
click on edit, find
typed in completed in the find what box
clicked on find next
selected the first row that was populated with completed
clicked on edit\cut
click on the completed worsheet to activate sheet
clicked on row 2 and clicked on edit, insert cut cells
clicked on the active exceptions worksheet to activate and deleted the now
blank line due to the cut done above.
Stop recording.

The code that was created from this recording was:
Columns("E:E").Select
Selection.Find(What:="completed", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Rows("5:5").Select
Selection.Cut
Sheets("Completed Requests").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown
Sheets("Active Requests").Select
Rows("5:5").Select
Selection.Delete Shift:=xlUp
End Sub

Now, the following line is coded into the macro: Rows("5:5").Select and
this seems to indicate that Row("5.5") is always the row to cut which, it
won't be...is there a way to code to say select the row no matter the
position that the completed value is in?



--
SherryW


"Don Guillett" wrote:

Let's see if we can get you started in learning how to do this.
1. record a macro while doing one manually to see what is happening.
2. Look in the vba help index for FINDNEXT and incorporate your procedure
into that.
3. Post back with specific questions.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SherryW" wrote in message
...
Hello, I am new to writing VBA code and am not sure where to start re
writing
code to do the following with excel:

a) Find the first instance of "completed" within the status field within
the active exceptions worksheet.
b) select the row that contains this status
c) copy or cut the row and insert copied cells into row 1 of the completed
worksheet (shifting the current data down within the completed worksheet)
d) delete the completed record that was selected and copied above.
e) loop until all compled status records have been moved to the completed
worksheet.

If anyone could help me with this one I would be very appreciative!
--
SherryW