General discussion
April 26, 2001 at 03:44 AM
raned

Editing Excel Database with a Macro

by raned . Updated 25 years, 2 months ago

I am trying to automate adding a new column to an existing database based on certain column criteria. One of the things I’m attempting to automate is to create a macro that Finds specific info. down one column, then tabs over four columns and enters a word. Then returns back to the original column and continues the same Find again and repeats the changes all the way down 10,000 entries.

I tried this macro:
Sub Macro2()

Cells.Find(What:=”k”, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Range(“E4225”).Select
ActiveSheet.Paste
Range(“A4226″).Select
Cells.Find(What:=”k”, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False).Activate
Range(“E4245”).Select
ActiveSheet.Paste
Range(“A4246”).Select

The problem with the macro above is it only wants to repeat the action for the rows it found when I recorded the macro. Is there a way to have the macro repeat the find command, and make changes to different rows all the way down a column?

Would appreciate any help

Thanks,

Randy

This discussion is locked

All Comments