Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm sorry for singling you out, but you've always given me great solutions.
This piece of code will be very crucial in my application. On a spreadsheet, I have colored yellow every range that i consider to be User Input. I have also re-named each of these ranges. I want a button to create a new workbook. I want to copy the names of the ranges that are user input. I also want to copy their values. This is so later, I can call on this file and re-use this user input. One of the big issues I am encountering is that some of the Named Ranges are larger than just a single cell. I have 3 particular ranges that are 10 cells X 10 cells. Later, if the user wants to call on one of these files containing the user input, I want to cycle through the names of the ranges that we saved, and copy them back to the yellow cells of the same name. If for some reason, this yellow cell has changed names or been deleted, I want to just skip that and move to the next. Thanks for any help! Steve |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How many cells are there in all range names together
-- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... I'm sorry for singling you out, but you've always given me great solutions. This piece of code will be very crucial in my application. On a spreadsheet, I have colored yellow every range that i consider to be User Input. I have also re-named each of these ranges. I want a button to create a new workbook. I want to copy the names of the ranges that are user input. I also want to copy their values. This is so later, I can call on this file and re-use this user input. One of the big issues I am encountering is that some of the Named Ranges are larger than just a single cell. I have 3 particular ranges that are 10 cells X 10 cells. Later, if the user wants to call on one of these files containing the user input, I want to cycle through the names of the ranges that we saved, and copy them back to the yellow cells of the same name. If for some reason, this yellow cell has changed names or been deleted, I want to just skip that and move to the next. Thanks for any help! Steve |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there about 30 user input cells that I have named. (these are individual cells)
then there are 3 "matrices" of data. they are 10 cells X 10 cells each. for example, I have named cells A1:J10 "EpoxyMatrix". this whole area is yellow for userinput. so in all, there are about 35 names that will be copied. down the road, this may increase or decrease. Thanks, Steve "Ron de Bruin" wrote: How many cells are there in all range names together -- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... I'm sorry for singling you out, but you've always given me great solutions. This piece of code will be very crucial in my application. On a spreadsheet, I have colored yellow every range that i consider to be User Input. I have also re-named each of these ranges. I want a button to create a new workbook. I want to copy the names of the ranges that are user input. I also want to copy their values. This is so later, I can call on this file and re-use this user input. One of the big issues I am encountering is that some of the Named Ranges are larger than just a single cell. I have 3 particular ranges that are 10 cells X 10 cells. Later, if the user wants to call on one of these files containing the user input, I want to cycle through the names of the ranges that we saved, and copy them back to the yellow cells of the same name. If for some reason, this yellow cell has changed names or been deleted, I want to just skip that and move to the next. Thanks for any help! Steve |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, I look at it after dinner
-- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... there about 30 user input cells that I have named. (these are individual cells) then there are 3 "matrices" of data. they are 10 cells X 10 cells each. for example, I have named cells A1:J10 "EpoxyMatrix". this whole area is yellow for userinput. so in all, there are about 35 names that will be copied. down the road, this may increase or decrease. Thanks, Steve "Ron de Bruin" wrote: How many cells are there in all range names together -- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... I'm sorry for singling you out, but you've always given me great solutions. This piece of code will be very crucial in my application. On a spreadsheet, I have colored yellow every range that i consider to be User Input. I have also re-named each of these ranges. I want a button to create a new workbook. I want to copy the names of the ranges that are user input. I also want to copy their values. This is so later, I can call on this file and re-use this user input. One of the big issues I am encountering is that some of the Named Ranges are larger than just a single cell. I have 3 particular ranges that are 10 cells X 10 cells. Later, if the user wants to call on one of these files containing the user input, I want to cycle through the names of the ranges that we saved, and copy them back to the yellow cells of the same name. If for some reason, this yellow cell has changed names or been deleted, I want to just skip that and move to the next. Thanks for any help! Steve |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steve
Not much time on this moment (my birthday today) But this is my idea to save your data to a new file in the same cell locations It not save the names but we not need that because the data is in the same cells. The Data is on a sheet named Sheet1 in my example and I save the files in C:\ with a date/time stamp Try it and let me know if this is a good start Sub Copy_named_ranges() Dim ws As Worksheet Dim wb As Workbook Dim Nwb As Workbook Dim Nme As name Set wb = ThisWorkbook Set ws = wb.Sheets("Sheet1") Set Nwb = Workbooks.Add(xlWBATWorksheet) wb.Activate For Each Nme In wb.Names If Left(Nme, Len(ws.name) + 1) = "=" & ws.name Then With ws.Range(Nme.name) .Copy Destination:=Nwb.Sheets(1).Range(.Address) End With End If Next Nwb.SaveAs "C:\" & Format(Now, "dd-mmm-yy h-mm-ss") & ".xls" Nwb.Close False End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... OK, I look at it after dinner -- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... there about 30 user input cells that I have named. (these are individual cells) then there are 3 "matrices" of data. they are 10 cells X 10 cells each. for example, I have named cells A1:J10 "EpoxyMatrix". this whole area is yellow for userinput. so in all, there are about 35 names that will be copied. down the road, this may increase or decrease. Thanks, Steve "Ron de Bruin" wrote: How many cells are there in all range names together -- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... I'm sorry for singling you out, but you've always given me great solutions. This piece of code will be very crucial in my application. On a spreadsheet, I have colored yellow every range that i consider to be User Input. I have also re-named each of these ranges. I want a button to create a new workbook. I want to copy the names of the ranges that are user input. I also want to copy their values. This is so later, I can call on this file and re-use this user input. One of the big issues I am encountering is that some of the Named Ranges are larger than just a single cell. I have 3 particular ranges that are 10 cells X 10 cells. Later, if the user wants to call on one of these files containing the user input, I want to cycle through the names of the ranges that we saved, and copy them back to the yellow cells of the same name. If for some reason, this yellow cell has changed names or been deleted, I want to just skip that and move to the next. Thanks for any help! Steve |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Happy Birthday Ron -- Casey ------------------------------------------------------------------------ Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545 View this thread: http://www.excelforum.com/showthread...hreadid=570728 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ron,
Happy Belated B-day! Thanks for the start, but I think I did a bad job explaining exactly what I need. I am using a workbook to bring in data from other workbooks (we'll call it "Book1") . Book1 will prompt the user to choose a file ("Book2"). When Book2 is selected & opened, I want to check the Named Ranges in Book2.Sheet1. Each time this Named Range also exists in Book1, I want to copy the value of the Named Range from Book2 to Book1. This seems a bit confusing. This is a program that Creates Quotes. Sometimes, we want to Re-Quote a project. Rather than type everythign in again, I give the user the option to "Import data" from another file. The reason i have to do it like this is that the data is not static enough to put into a structured database. In other words, my boss changes the way we price things (variables are added, deleted, renamed) By importing data like this, I can bring in all of the data that is still relevant, and ignore anything else that doesn't match up. Thanks! Steve "Ron de Bruin" wrote: Hi Steve Not much time on this moment (my birthday today) But this is my idea to save your data to a new file in the same cell locations It not save the names but we not need that because the data is in the same cells. The Data is on a sheet named Sheet1 in my example and I save the files in C:\ with a date/time stamp Try it and let me know if this is a good start Sub Copy_named_ranges() Dim ws As Worksheet Dim wb As Workbook Dim Nwb As Workbook Dim Nme As name Set wb = ThisWorkbook Set ws = wb.Sheets("Sheet1") Set Nwb = Workbooks.Add(xlWBATWorksheet) wb.Activate For Each Nme In wb.Names If Left(Nme, Len(ws.name) + 1) = "=" & ws.name Then With ws.Range(Nme.name) .Copy Destination:=Nwb.Sheets(1).Range(.Address) End With End If Next Nwb.SaveAs "C:\" & Format(Now, "dd-mmm-yy h-mm-ss") & ".xls" Nwb.Close False End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ron de Bruin" wrote in message ... OK, I look at it after dinner -- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... there about 30 user input cells that I have named. (these are individual cells) then there are 3 "matrices" of data. they are 10 cells X 10 cells each. for example, I have named cells A1:J10 "EpoxyMatrix". this whole area is yellow for userinput. so in all, there are about 35 names that will be copied. down the road, this may increase or decrease. Thanks, Steve "Ron de Bruin" wrote: How many cells are there in all range names together -- Regards Ron de Bruin http://www.rondebruin.nl "steve" wrote in message ... I'm sorry for singling you out, but you've always given me great solutions. This piece of code will be very crucial in my application. On a spreadsheet, I have colored yellow every range that i consider to be User Input. I have also re-named each of these ranges. I want a button to create a new workbook. I want to copy the names of the ranges that are user input. I also want to copy their values. This is so later, I can call on this file and re-use this user input. One of the big issues I am encountering is that some of the Named Ranges are larger than just a single cell. I have 3 particular ranges that are 10 cells X 10 cells. Later, if the user wants to call on one of these files containing the user input, I want to cycle through the names of the ranges that we saved, and copy them back to the yellow cells of the same name. If for some reason, this yellow cell has changed names or been deleted, I want to just skip that and move to the next. Thanks for any help! Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Q4 Ron de Bruin | Excel Programming | |||
Ron de Bruin (ADO help) | Excel Programming | |||
ATT: Ron de Bruin (ADO help) | Excel Programming | |||
? for Ron de Bruin | Excel Programming | |||
for Ron de Bruin | Excel Programming |