Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Work with the home key. | Excel Discussion (Misc queries) | |||
work from home | Excel Discussion (Misc queries) | |||
How do I take a toolbar created at home and install it at work? | Excel Discussion (Misc queries) | |||
another language in MS office at home and another at work | Excel Worksheet Functions | |||
same workbook different paths (home/work) | Excel Programming |