Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default changing values acroos worksheets

Hello and good morning to all!

I got a problem...due to lack of experiance i didnt do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in the
A2 column has a list of plant with the cost for each in
the A3 column. each sheet is a different lists (random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost has
changed for many of the plants. Is there a way i can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd be
okay.
but for now , is there a macro i need to create for this
or is there a function i do not know of to do this?

thanks again to all who helps?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default changing values acroos worksheets

update...my plantlist is 63Rows. if it helps any.

-----Original Message-----
Hello and good morning to all!

I got a problem...due to lack of experiance i didnt do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in the
A2 column has a list of plant with the cost for each in
the A3 column. each sheet is a different lists (random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost has
changed for many of the plants. Is there a way i can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd be
okay.
but for now , is there a macro i need to create for this
or is there a function i do not know of to do this?

thanks again to all who helps?

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default changing values acroos worksheets

Assume you have a list of plants and their costs on a sheet named Data

Column A lists the plants as they would appear on the 33 worksheets (in
column B of those sheets) and column B (of Data) the new cost

Assume on the 33 worksheets, the plants are listed in column B with the cost
in column C (you stated in columns A2 and A3, but I assume you meant in
column B and column C, since A2 and A3 are meaningless in terms of column
locations)

Assume the 33 sheets are the last 33 sheets in the workbook

Sub ChangeCosts()
Dim rngData As Range
Dim firstSheet As Long
Dim i As Long, sh As Worksheet
Dim rng As Range, Cell As Range
Dim res As Variant
rngData = Worksheets("Data").Range("A1:B500")
firstSheet = Sheets.Count - 33 + 1

For i = firstSheet To Sheets.Count
Set sh = Sheets(i)
Set rng = sh.Range(sh.Cells(1, 2), sh.Cells(Rows.Count, 2).End(xlUp))
For Each Cell In rng
res = Application.VLookup(Cell.Value, rngData, 2, False)
If Not IsError(res) Then
Cell.Offset(0, 1).Value = res
Cell.Offset(0, 1).Interior.ColorIndex = 5 ' color cell, optional
End If
Next Cell
Next i
End Sub


Obviously test this on a copy of your workbook.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
Hello and good morning to all!

I got a problem...due to lack of experiance i didnt do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in the
A2 column has a list of plant with the cost for each in
the A3 column. each sheet is a different lists (random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost has
changed for many of the plants. Is there a way i can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd be
okay.
but for now , is there a macro i need to create for this
or is there a function i do not know of to do this?

thanks again to all who helps?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default changing values acroos worksheets

tom,

the plant do not appear as exactly as they do on the
sheets. each sheet has a selection picked form the
list..would that matter?
the columns areas areas they are respectively to the
columns.
"B" and "C"..

thanks

-----Original Message-----
Assume you have a list of plants and their costs on a

sheet named Data

Column A lists the plants as they would appear on the 33

worksheets (in
column B of those sheets) and column B (of Data) the new

cost

Assume on the 33 worksheets, the plants are listed in

column B with the cost
in column C (you stated in columns A2 and A3, but I

assume you meant in
column B and column C, since A2 and A3 are meaningless

in terms of column
locations)

Assume the 33 sheets are the last 33 sheets in the

workbook

Sub ChangeCosts()
Dim rngData As Range
Dim firstSheet As Long
Dim i As Long, sh As Worksheet
Dim rng As Range, Cell As Range
Dim res As Variant
rngData = Worksheets("Data").Range("A1:B500")
firstSheet = Sheets.Count - 33 + 1

For i = firstSheet To Sheets.Count
Set sh = Sheets(i)
Set rng = sh.Range(sh.Cells(1, 2), sh.Cells

(Rows.Count, 2).End(xlUp))
For Each Cell In rng
res = Application.VLookup(Cell.Value, rngData, 2,

False)
If Not IsError(res) Then
Cell.Offset(0, 1).Value = res
Cell.Offset(0, 1).Interior.ColorIndex = 5 ' color

cell, optional
End If
Next Cell
Next i
End Sub


Obviously test this on a copy of your workbook.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
Hello and good morning to all!

I got a problem...due to lack of experiance i didnt do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in

the
A2 column has a list of plant with the cost for each in
the A3 column. each sheet is a different lists

(random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost has
changed for many of the plants. Is there a way i can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd be
okay.
but for now , is there a macro i need to create for

this
or is there a function i do not know of to do this?

thanks again to all who helps?



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default changing values acroos worksheets

If the name of a plant is

Buttercup, Yellow, medium

on both the sheet you want to change and the sheet where you will lookup the
price is what I mean by are the same on both sheets. Note that the list of
plants on one sheet does not have to match the list of plants on the other
lookup sheet (that would be pointless). Note that I am using Vlookup same
as you suggested you should have done originally. So if you now entered
Vlookup on one of the 33 worksheets in column C, referring to the plant for
that row in column B (as the lookup value) and that would work, then the
code should work.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
tom,

the plant do not appear as exactly as they do on the
sheets. each sheet has a selection picked form the
list..would that matter?
the columns areas areas they are respectively to the
columns.
"B" and "C"..

thanks

-----Original Message-----
Assume you have a list of plants and their costs on a

sheet named Data

Column A lists the plants as they would appear on the 33

worksheets (in
column B of those sheets) and column B (of Data) the new

cost

Assume on the 33 worksheets, the plants are listed in

column B with the cost
in column C (you stated in columns A2 and A3, but I

assume you meant in
column B and column C, since A2 and A3 are meaningless

in terms of column
locations)

Assume the 33 sheets are the last 33 sheets in the

workbook

Sub ChangeCosts()
Dim rngData As Range
Dim firstSheet As Long
Dim i As Long, sh As Worksheet
Dim rng As Range, Cell As Range
Dim res As Variant
rngData = Worksheets("Data").Range("A1:B500")
firstSheet = Sheets.Count - 33 + 1

For i = firstSheet To Sheets.Count
Set sh = Sheets(i)
Set rng = sh.Range(sh.Cells(1, 2), sh.Cells

(Rows.Count, 2).End(xlUp))
For Each Cell In rng
res = Application.VLookup(Cell.Value, rngData, 2,

False)
If Not IsError(res) Then
Cell.Offset(0, 1).Value = res
Cell.Offset(0, 1).Interior.ColorIndex = 5 ' color

cell, optional
End If
Next Cell
Next i
End Sub


Obviously test this on a copy of your workbook.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
Hello and good morning to all!

I got a problem...due to lack of experiance i didnt do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in

the
A2 column has a list of plant with the cost for each in
the A3 column. each sheet is a different lists

(random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost has
changed for many of the plants. Is there a way i can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd be
okay.
but for now , is there a macro i need to create for

this
or is there a function i do not know of to do this?

thanks again to all who helps?



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
mlm mlm is offline
external usenet poster
 
Posts: 10
Default changing values acroos worksheets

YEs.. thank you it worked..


-----Original Message-----
If the name of a plant is

Buttercup, Yellow, medium

on both the sheet you want to change and the sheet where

you will lookup the
price is what I mean by are the same on both sheets.

Note that the list of
plants on one sheet does not have to match the list of

plants on the other
lookup sheet (that would be pointless). Note that I am

using Vlookup same
as you suggested you should have done originally. So if

you now entered
Vlookup on one of the 33 worksheets in column C,

referring to the plant for
that row in column B (as the lookup value) and that

would work, then the
code should work.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
tom,

the plant do not appear as exactly as they do on the
sheets. each sheet has a selection picked form the
list..would that matter?
the columns areas areas they are respectively to the
columns.
"B" and "C"..

thanks

-----Original Message-----
Assume you have a list of plants and their costs on a

sheet named Data

Column A lists the plants as they would appear on the

33
worksheets (in
column B of those sheets) and column B (of Data) the

new
cost

Assume on the 33 worksheets, the plants are listed in

column B with the cost
in column C (you stated in columns A2 and A3, but I

assume you meant in
column B and column C, since A2 and A3 are meaningless

in terms of column
locations)

Assume the 33 sheets are the last 33 sheets in the

workbook

Sub ChangeCosts()
Dim rngData As Range
Dim firstSheet As Long
Dim i As Long, sh As Worksheet
Dim rng As Range, Cell As Range
Dim res As Variant
rngData = Worksheets("Data").Range("A1:B500")
firstSheet = Sheets.Count - 33 + 1

For i = firstSheet To Sheets.Count
Set sh = Sheets(i)
Set rng = sh.Range(sh.Cells(1, 2), sh.Cells

(Rows.Count, 2).End(xlUp))
For Each Cell In rng
res = Application.VLookup(Cell.Value, rngData, 2,

False)
If Not IsError(res) Then
Cell.Offset(0, 1).Value = res
Cell.Offset(0, 1).Interior.ColorIndex = 5 '

color
cell, optional
End If
Next Cell
Next i
End Sub


Obviously test this on a copy of your workbook.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
Hello and good morning to all!

I got a problem...due to lack of experiance i didnt

do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in

the
A2 column has a list of plant with the cost for

each in
the A3 column. each sheet is a different lists

(random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost

has
changed for many of the plants. Is there a way i

can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd

be
okay.
but for now , is there a macro i need to create for

this
or is there a function i do not know of to do this?

thanks again to all who helps?



.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default changing values acroos worksheets

okay, i see what this does but i am a bit lost on the
process of it. I put this code in the This workbook
module?
and then how do i actually tell it what i want to change?
or actually i am leaning to thinking it changes evrything
in the list on hte worksheet to have a vlooup value??
right? is that what it is doing? so all i have to do it
change the plant list whenever prices change?

maybei am thinking too hard again.
mike, thanks
-----Original Message-----
If the name of a plant is

Buttercup, Yellow, medium

on both the sheet you want to change and the sheet where

you will lookup the
price is what I mean by are the same on both sheets.

Note that the list of
plants on one sheet does not have to match the list of

plants on the other
lookup sheet (that would be pointless). Note that I am

using Vlookup same
as you suggested you should have done originally. So if

you now entered
Vlookup on one of the 33 worksheets in column C,

referring to the plant for
that row in column B (as the lookup value) and that

would work, then the
code should work.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
tom,

the plant do not appear as exactly as they do on the
sheets. each sheet has a selection picked form the
list..would that matter?
the columns areas areas they are respectively to the
columns.
"B" and "C"..

thanks

-----Original Message-----
Assume you have a list of plants and their costs on a

sheet named Data

Column A lists the plants as they would appear on the

33
worksheets (in
column B of those sheets) and column B (of Data) the

new
cost

Assume on the 33 worksheets, the plants are listed in

column B with the cost
in column C (you stated in columns A2 and A3, but I

assume you meant in
column B and column C, since A2 and A3 are meaningless

in terms of column
locations)

Assume the 33 sheets are the last 33 sheets in the

workbook

Sub ChangeCosts()
Dim rngData As Range
Dim firstSheet As Long
Dim i As Long, sh As Worksheet
Dim rng As Range, Cell As Range
Dim res As Variant
rngData = Worksheets("Data").Range("A1:B500")
firstSheet = Sheets.Count - 33 + 1

For i = firstSheet To Sheets.Count
Set sh = Sheets(i)
Set rng = sh.Range(sh.Cells(1, 2), sh.Cells

(Rows.Count, 2).End(xlUp))
For Each Cell In rng
res = Application.VLookup(Cell.Value, rngData, 2,

False)
If Not IsError(res) Then
Cell.Offset(0, 1).Value = res
Cell.Offset(0, 1).Interior.ColorIndex = 5 '

color
cell, optional
End If
Next Cell
Next i
End Sub


Obviously test this on a copy of your workbook.

--
Regards,
Tom Ogilvy


"mike" wrote in message
...
Hello and good morning to all!

I got a problem...due to lack of experiance i didnt

do
this ina better way.
I have a workbook with 33wrkshts. each worksheets in

the
A2 column has a list of plant with the cost for

each in
the A3 column. each sheet is a different lists

(random).
one worksheets is a individual area.
so..here smy deal. i have a plantlist in a worksheet
alone and use it as a refernce for a userform.
now i recently discovered that the plant lists cost

has
changed for many of the plants. Is there a way i

can go
thru and change the values in A3 for the neccessary
plants.
If i had done a vlookup the first time around, i 'd

be
okay.
but for now , is there a macro i need to create for

this
or is there a function i do not know of to do this?

thanks again to all who helps?



.



.

Reply
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
Decimals instead of whole numbers acroos pivot Frenchie New Users to Excel 1 May 8th 09 08:21 PM
Linking Changing Values Between Worksheets Chris Chringle Excel Discussion (Misc queries) 1 August 1st 08 12:25 AM
How to calculate percentage acroos sheets in a workbook tosh105 Excel Discussion (Misc queries) 5 April 27th 06 10:39 PM
Linking changing values (cells) between worksheets. Tumbleweed Excel Worksheet Functions 2 August 18th 05 04:29 AM
Create Worksheets Based Upon Changing Column Values in XP Gary[_12_] Excel Programming 1 December 18th 03 12:07 AM


All times are GMT +1. The time now is 12:02 PM.

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

About Us

"It's about Microsoft Excel"