PDA

View Full Version : Solved: Data Change 2



drums4monty
03-10-2008, 01:48 AM
I have a worksheet and need to change some data in one of the cells. The sheets that need to be changed are 2 to 63 inclusive. The problem, the sheets are all the same apart from the word 'Name Badges' is in A44 or A45, and the price '2.40' there for needs to go into I44 or I45. How do you do this?

Bob Phillips
03-10-2008, 02:43 AM
Are you saying that you want to loop the sheets and move A44 to I44, A45 to I5.

drums4monty
03-10-2008, 04:05 AM
No, I want to update either I44 or I45 with the figure 2.40, if A44 has the word Name Badges in the Cell then I44 would be updated or if A45 has the word Name Badges in the cell then I45 would be updated.

Bob Phillips
03-10-2008, 05:02 AM
For i = 2 To 63

With Worksheets(i)

If .Range("A44").Value = "Badges" Then .Range("I44").Value = 2.4
If .Range("A45").Value = "Badges" Then .Range("I45").Value = 2.4
End With
Next i
End Sub

drums4monty
03-10-2008, 11:43 PM
Thanks Bob thats great. I thought it would be along those lines, its just learning what to write and how to do it.

Bob Phillips
03-11-2008, 01:23 AM
You'll soon be rolling it off as second nature.