ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro Help (https://www.excelbanter.com/excel-discussion-misc-queries/57236-macro-help.html)

DNA

Macro Help
 
I'm sure this will be a Macro:

I have several sheets with a workbook that contain part numbers. If a
part number = X, then place an employee number in the next column directly
beside the part number column.

NOTE: Part numbers vary from column to column throughout the work book.

Thanks for your help!!


Don Guillett

Macro Help
 
Have a look in VBA help index for FINDNEXT. There is a good example you can
modify.

--
Don Guillett
SalesAid Software

"DNA" wrote in message
lkaboutsoftware.com...
I'm sure this will be a Macro:

I have several sheets with a workbook that contain part numbers. If a
part number = X, then place an employee number in the next column directly
beside the part number column.

NOTE: Part numbers vary from column to column throughout the work book.

Thanks for your help!!




DNA

Macro Help
 
It doesn't appear that FINDNEXT would be the choice I should use.

I want one macro that searches all worksheets, and if it finds a part
number of 54789, then put employee number 005 in the column directly
beside the part number. This way when one value is entered, it populates
the entire workbook.

Hope this makes sense.


Don Guillett

Macro Help
 
Still not clear what you want. If desired you may send to the address BELOW
a SMALL workbook example and I will take a look. With that make a CLEAR
explanation of what you want as I will not go back to this thread to look at
the problem.

--
Don Guillett
SalesAid Software

"DNA" wrote in message
lkaboutsoftware.com...
It doesn't appear that FINDNEXT would be the choice I should use.

I want one macro that searches all worksheets, and if it finds a part
number of 54789, then put employee number 005 in the column directly
beside the part number. This way when one value is entered, it populates
the entire workbook.

Hope this makes sense.




Don Guillett

Macro Help
 
Why not? Modified from Help. I added the for each sh loop

Sub findnumbersinallworksheets()
For Each sh In Worksheets
With sh.Cells
Set c = .Find(54789, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do

c.Offset(, 1) = "005"
c.Offset(, 1).NumberFormat = "000"

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
Next sh
End Sub

--
Don Guillett
SalesAid Software

"DNA" wrote in message
lkaboutsoftware.com...
It doesn't appear that FINDNEXT would be the choice I should use.

I want one macro that searches all worksheets, and if it finds a part
number of 54789, then put employee number 005 in the column directly
beside the part number. This way when one value is entered, it populates
the entire workbook.

Hope this makes sense.





All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com