Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to macros, need to update worksheets
I've just learned how to do macros in a class and am hoping to apply it to
something at work. We have a workbook (with MANY spreadsheets) that reflect billing. The main sheet is updated each month - Column H has January info and Column I will have Feb info. Then there are sheets for each program. Each sheet has some numerical data and a chart. After January's information was entered, the data on each sheet was manually changed to refer to column H. Once Feb's info is entered, it will manually be changed to refer to column I (the new data). Is this something that can be automated with a macro?? Bear with me because this is to new to me, but I know there has to be a better way to handle this workbook. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to macros, need to update worksheets
-- Are all the sheets except for the main sheet to be updated?
-- Is it the same cells in each program sheet that need to be updated? -- How would you identify which cells on the main sheet contain the updated data for each specific program? Ed "Tina" wrote in message ... I've just learned how to do macros in a class and am hoping to apply it to something at work. We have a workbook (with MANY spreadsheets) that reflect billing. The main sheet is updated each month - Column H has January info and Column I will have Feb info. Then there are sheets for each program. Each sheet has some numerical data and a chart. After January's information was entered, the data on each sheet was manually changed to refer to column H. Once Feb's info is entered, it will manually be changed to refer to column I (the new data). Is this something that can be automated with a macro?? Bear with me because this is to new to me, but I know there has to be a better way to handle this workbook. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to macros, need to update worksheets
see below - thanks
"Ed" wrote: -- Are all the sheets except for the main sheet to be updated? YES -- Is it the same cells in each program sheet that need to be updated? YES -- How would you identify which cells on the main sheet contain the updated data for each specific program? I DON'T KNOW - I'm honestly not sure how to go about this... Ed "Tina" wrote in message ... I've just learned how to do macros in a class and am hoping to apply it to something at work. We have a workbook (with MANY spreadsheets) that reflect billing. The main sheet is updated each month - Column H has January info and Column I will have Feb info. Then there are sheets for each program. Each sheet has some numerical data and a chart. After January's information was entered, the data on each sheet was manually changed to refer to column H. Once Feb's info is entered, it will manually be changed to refer to column I (the new data). Is this something that can be automated with a macro?? Bear with me because this is to new to me, but I know there has to be a better way to handle this workbook. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to macros, need to update worksheets
-- How would you identify which cells on the main sheet contain the
updated data for each specific program? I DON'T KNOW - I'm honestly not sure how to go about this... What I mean is: when you look at the main sheet, how do you know which data cells go with which program? For instance, is the program name listed down Column A, and the data for that program is in H of the same row? How many cells need to be updated from the main sheet, and how do you know which ones they are? The biggest thing to remember about any routine like this is that it can almost always be broken into smaller increments. When you take it one step at a time, it's not so very intimidating. You do have to be able to identify the process you would use without a macro, because your macro is going to have to do that same process. And what we know intuitively when we look at our work has to be spelled out in detail for in the code. Try this: -- Create a new Excel workbook and give it some more worksheets. -- Put the macro below into a module. (With Excel open, press ALT+F11 - this opens the Visual Basic Editor (VBE). Go to Insert Module. Copy everything below from "Sub UpdateAllSheets()" to "End Sub".) -- Back in Excel, press ALT+F8 to bring up a list of macros. Choose "UpdateAllSheets" and see what happens. (The macro sets the Zoom percentage for every sheet except Sheet1.) -- Go back to the VBE and look at the code, and see if you can understand what the code is doing. Ed Sub UpdateAllSheets() Dim objWkbk As Workbook Dim objWksh As Worksheet Dim strZm As String Dim intZm As Integer Set objWkbk = ActiveWorkbook strZm = InputBox("What zoom?") If strZm = "" Then GoTo ExitHere intZm = strZm For Each objWksh In objWkbk.Sheets If objWksh.Name < "Sheet1" Then objWksh.Activate ActiveWindow.Zoom = intZm objWksh.Range("A1").Select End If Next objWksh objWkbk.Sheets("Sheet1").Activate ExitHe End Sub "Tina" wrote in message ... see below - thanks "Ed" wrote: -- Are all the sheets except for the main sheet to be updated? YES -- Is it the same cells in each program sheet that need to be updated? YES -- How would you identify which cells on the main sheet contain the updated data for each specific program? I DON'T KNOW - I'm honestly not sure how to go about this... Ed "Tina" wrote in message ... I've just learned how to do macros in a class and am hoping to apply it to something at work. We have a workbook (with MANY spreadsheets) that reflect billing. The main sheet is updated each month - Column H has January info and Column I will have Feb info. Then there are sheets for each program. Each sheet has some numerical data and a chart. After January's information was entered, the data on each sheet was manually changed to refer to column H. Once Feb's info is entered, it will manually be changed to refer to column I (the new data). Is this something that can be automated with a macro?? Bear with me because this is to new to me, but I know there has to be a better way to handle this workbook. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I update charts using macros | Charts and Charting in Excel | |||
Macros To Update Charts | Excel Programming | |||
Macros to Open & Update Files | Excel Programming | |||
Problem Organizing Macros under XP UPDATE | Excel Programming | |||
Update Links/Trust Macros? | Excel Programming |