Solved

refreshing data in Excel spreadsheet that has named fields

Posted on 2014-10-03
11
96 Views
Last Modified: 2014-10-07
Experts,

I have an Excel spreadsheet that I refresh each month with new data.  Currently I am just pasting the new data over the old data because I have named fields that are used on other sheets for calculations using formulas.

Is there a way through VBA to refresh  tab "Old_Data"  on WorkbookA with "New_Data" from WorkbookB and not lose my named fields.
0
Comment
Question by:morinia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40359316
IS YOUR NAMED fields are dynamic range?
0
 

Author Comment

by:morinia
ID: 40359335
Attached is a sample of one of the field definitions.   It is using an entire column.
Named-Field.PNG.doc
0
 
LVL 26

Accepted Solution

by:
ProfessorJimJam earned 500 total points
ID: 40359561
check the attached files, one is old data main one and the other is new one.  

RUN THE MACRO "REFRESHSHEETFROMANOTHERWB" which is IN WORKBOOK A  .

it is tested and it works.

let me know the result.
WORKBOOKA.xlsb
WORKBOOKB.xlsb
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:morinia
ID: 40359841
It works perfectly when there is one worksheet in  workbook.  My challenge is I have more than one worksheet in both workbooks.
0
 

Author Comment

by:morinia
ID: 40359918
I can create a separate workbook each respective "New Data" sheets  but the "Old Data"workbook has multiple sheets
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40359923
you did not mention that you have more worksheets.  check your initial message.  the macros that i have created is exactly as per your request.

so can you elaborate how many worksheets in Workbook A and how many Worksheets in WorkbookB exists and which worksheets and thier names from B needs to be copied in how many worksheets of Workbook A?
0
 

Author Comment

by:morinia
ID: 40359955
I am sorry for the understating.  I thought I could take the code and modify it .

 I can create a separate workbook for each input sheet.  Medical Hospital Inpatient and Outpatient

The workbook to be updated has four sheets that are to be refreshed  The entire workbook has 22 sheets.  

The other sheets use the data from the refreshed sheets through vlookups and sumifs.

The sheets to be updated are:   Medical Hospital Inpatient and Outpatient
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40359957
can you post a dummy example and explain how you want it. so that, i could get it right this time.
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40359962
becuase your last explanation is still not clear.   so the four sheets to be updated are in workbookA right?
and what are the other sheets in workbookB to serve as a source of data for the WorkbookA sheets?
0
 

Author Comment

by:morinia
ID: 40360083
I will create four workbooks:

There are four workbooks:  
     Medical
     Hospital
     Inpatient
     Outpatient

They will be used to update the respective sheet on Old_Workbook which has multiple sheets.  The "sheets"  to be updated have the same name as the individual workbooks listed above.
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40363981
from your initial thread question,   I have provided you with what was needed exactly as per your question.

now, you have came up with additional request, it would appropriate to mark this thread as accepted completed.
and open a new thread, so that we look at that as a new requirement of solution for excel workbooks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question