Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Home Work Help Excel VBA

I am not sure if anyone can help quick enough, but I need some help for
some extra credit due tomorrow morning. I do not know any thing in
excel vba so if you can dumb it down some that would be great.

Here is what I have to do:

1. create a variable named "OldRegion" and set it to cell c2
2. create a variable named "NewRegion" and set it to cell d21
3. change the text of the status bar to "retriveving data on new...,"
where NewRegion is the value of the NewRegion variable.
4. Replace all occurences of "OldRegion" with "NewRegion" in cell range
A1:F19
5. Set the value of status bar back to false.


And here is what I have, but of course it's not working

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on NewRegion"

Application.StatusBar = False


Any help would be great and my parents would be greatfull also...Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Home Work Help Excel VBA

Looks like you pretty much have it:

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on " & NewRegion
Dim cell as Range
for each cell in Range("A1:F19")
if lcase(cell.Value) = lcase(oldregion) then
cell.Value = newregion
end if
Next

Application.StatusBar = False


If C2 and D21 contain numbers then

for each cell in Range("A1:F19")
if cell.Value = oldregion then
cell.Value = newregion
end if
Next

note that you will change the current value of C2

--
Regards,
Tom Ogilvy



You could also to the replace by using he replace command (which you can get
the format for by turning on the macro recorder and doing it manually).

--
Regards,
Tom Ogilvy


"not very bright" wrote in message
ups.com...
I am not sure if anyone can help quick enough, but I need some help for
some extra credit due tomorrow morning. I do not know any thing in
excel vba so if you can dumb it down some that would be great.

Here is what I have to do:

1. create a variable named "OldRegion" and set it to cell c2
2. create a variable named "NewRegion" and set it to cell d21
3. change the text of the status bar to "retriveving data on new...,"
where NewRegion is the value of the NewRegion variable.
4. Replace all occurences of "OldRegion" with "NewRegion" in cell range
A1:F19
5. Set the value of status bar back to false.


And here is what I have, but of course it's not working

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on NewRegion"

Application.StatusBar = False


Any help would be great and my parents would be greatfull also...Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Home Work Help Excel VBA

Thanks for the help I think I am almost there, but It is not quite
working. Maybe a little more information. Cells C2 and D21 reference a
worksheet in another workbook. I should be able change the region with
a drop down box and when I am done I click on the macro button and that
should bring up the data for that particular worksheet.

Mark
Tom Ogilvy wrote:
Looks like you pretty much have it:

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on " & NewRegion
Dim cell as Range
for each cell in Range("A1:F19")
if lcase(cell.Value) = lcase(oldregion) then
cell.Value = newregion
end if
Next

Application.StatusBar = False


If C2 and D21 contain numbers then

for each cell in Range("A1:F19")
if cell.Value = oldregion then
cell.Value = newregion
end if
Next

note that you will change the current value of C2

--
Regards,
Tom Ogilvy



You could also to the replace by using he replace command (which you can get
the format for by turning on the macro recorder and doing it manually).

--
Regards,
Tom Ogilvy


"not very bright" wrote in message
ups.com...
I am not sure if anyone can help quick enough, but I need some help for
some extra credit due tomorrow morning. I do not know any thing in
excel vba so if you can dumb it down some that would be great.

Here is what I have to do:

1. create a variable named "OldRegion" and set it to cell c2
2. create a variable named "NewRegion" and set it to cell d21
3. change the text of the status bar to "retriveving data on new...,"
where NewRegion is the value of the NewRegion variable.
4. Replace all occurences of "OldRegion" with "NewRegion" in cell range
A1:F19
5. Set the value of status bar back to false.


And here is what I have, but of course it's not working

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on NewRegion"

Application.StatusBar = False


Any help would be great and my parents would be greatfull also...Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Home Work Help Excel VBA

With a detailed description like that, I wouldn't know where to start.

--
Regards,
Tom Ogilvy



"not very bright" wrote in message
ups.com...
Thanks for the help I think I am almost there, but It is not quite
working. Maybe a little more information. Cells C2 and D21 reference a
worksheet in another workbook. I should be able change the region with
a drop down box and when I am done I click on the macro button and that
should bring up the data for that particular worksheet.

Mark
Tom Ogilvy wrote:
Looks like you pretty much have it:

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on " & NewRegion
Dim cell as Range
for each cell in Range("A1:F19")
if lcase(cell.Value) = lcase(oldregion) then
cell.Value = newregion
end if
Next

Application.StatusBar = False


If C2 and D21 contain numbers then

for each cell in Range("A1:F19")
if cell.Value = oldregion then
cell.Value = newregion
end if
Next

note that you will change the current value of C2

--
Regards,
Tom Ogilvy



You could also to the replace by using he replace command (which you can
get
the format for by turning on the macro recorder and doing it manually).

--
Regards,
Tom Ogilvy


"not very bright" wrote in message
ups.com...
I am not sure if anyone can help quick enough, but I need some help for
some extra credit due tomorrow morning. I do not know any thing in
excel vba so if you can dumb it down some that would be great.

Here is what I have to do:

1. create a variable named "OldRegion" and set it to cell c2
2. create a variable named "NewRegion" and set it to cell d21
3. change the text of the status bar to "retriveving data on new...,"
where NewRegion is the value of the NewRegion variable.
4. Replace all occurences of "OldRegion" with "NewRegion" in cell range
A1:F19
5. Set the value of status bar back to false.


And here is what I have, but of course it's not working

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on NewRegion"

Application.StatusBar = False


Any help would be great and my parents would be greatfull also...Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Home Work Help Excel VBA

Can I email it to you?


Tom Ogilvy wrote:
With a detailed description like that, I wouldn't know where to start.

--
Regards,
Tom Ogilvy



"not very bright" wrote in message
ups.com...
Thanks for the help I think I am almost there, but It is not quite
working. Maybe a little more information. Cells C2 and D21 reference a
worksheet in another workbook. I should be able change the region with
a drop down box and when I am done I click on the macro button and that
should bring up the data for that particular worksheet.

Mark
Tom Ogilvy wrote:
Looks like you pretty much have it:

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on " & NewRegion
Dim cell as Range
for each cell in Range("A1:F19")
if lcase(cell.Value) = lcase(oldregion) then
cell.Value = newregion
end if
Next

Application.StatusBar = False


If C2 and D21 contain numbers then

for each cell in Range("A1:F19")
if cell.Value = oldregion then
cell.Value = newregion
end if
Next

note that you will change the current value of C2

--
Regards,
Tom Ogilvy



You could also to the replace by using he replace command (which you can
get
the format for by turning on the macro recorder and doing it manually).

--
Regards,
Tom Ogilvy


"not very bright" wrote in message
ups.com...
I am not sure if anyone can help quick enough, but I need some help for
some extra credit due tomorrow morning. I do not know any thing in
excel vba so if you can dumb it down some that would be great.

Here is what I have to do:

1. create a variable named "OldRegion" and set it to cell c2
2. create a variable named "NewRegion" and set it to cell d21
3. change the text of the status bar to "retriveving data on new...,"
where NewRegion is the value of the NewRegion variable.
4. Replace all occurences of "OldRegion" with "NewRegion" in cell range
A1:F19
5. Set the value of status bar back to false.


And here is what I have, but of course it's not working

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on NewRegion"

Application.StatusBar = False


Any help would be great and my parents would be greatfull also...Thanks





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Home Work Help Excel VBA

If you want to



--
Regards,
Tom Ogilvy


"not very bright" wrote in message
ps.com...
Can I email it to you?


Tom Ogilvy wrote:
With a detailed description like that, I wouldn't know where to start.

--
Regards,
Tom Ogilvy



"not very bright" wrote in message
ups.com...
Thanks for the help I think I am almost there, but It is not quite
working. Maybe a little more information. Cells C2 and D21 reference a
worksheet in another workbook. I should be able change the region with
a drop down box and when I am done I click on the macro button and that
should bring up the data for that particular worksheet.

Mark
Tom Ogilvy wrote:
Looks like you pretty much have it:

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on " & NewRegion
Dim cell as Range
for each cell in Range("A1:F19")
if lcase(cell.Value) = lcase(oldregion) then
cell.Value = newregion
end if
Next

Application.StatusBar = False


If C2 and D21 contain numbers then

for each cell in Range("A1:F19")
if cell.Value = oldregion then
cell.Value = newregion
end if
Next

note that you will change the current value of C2

--
Regards,
Tom Ogilvy



You could also to the replace by using he replace command (which you
can
get
the format for by turning on the macro recorder and doing it
manually).

--
Regards,
Tom Ogilvy


"not very bright" wrote in message
ups.com...
I am not sure if anyone can help quick enough, but I need some help
for
some extra credit due tomorrow morning. I do not know any thing in
excel vba so if you can dumb it down some that would be great.

Here is what I have to do:

1. create a variable named "OldRegion" and set it to cell c2
2. create a variable named "NewRegion" and set it to cell d21
3. change the text of the status bar to "retriveving data on
new...,"
where NewRegion is the value of the NewRegion variable.
4. Replace all occurences of "OldRegion" with "NewRegion" in cell
range
A1:F19
5. Set the value of status bar back to false.


And here is what I have, but of course it's not working

Dim OldRegion
OldRegion = Range("C2").Value
Dim NewRegion
NewRegion = Range("D21").Value
Application.StatusBar = "Retrieving Data on NewRegion"

Application.StatusBar = False


Any help would be great and my parents would be greatfull
also...Thanks





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
Work with the home key. Yardzilla Excel Discussion (Misc queries) 1 December 12th 08 09:36 PM
work from home apzc18ti Excel Discussion (Misc queries) 0 November 26th 07 11:42 PM
How do I take a toolbar created at home and install it at work? lhcook Excel Discussion (Misc queries) 2 May 4th 06 09:06 PM
another language in MS office at home and another at work milazalu Excel Worksheet Functions 2 July 7th 05 09:54 PM
same workbook different paths (home/work) jeffP Excel Programming 4 September 14th 04 04:48 AM


All times are GMT +1. The time now is 01:17 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"