Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
I have code that sets a named range automaticlly now i am trying copy that
range to anither sheet in the workbook but everthing i have tried fails. any help would be appriciated thank you in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
Tell us more
-- Don Guillett Microsoft MVP Excel SalesAid Software "jhyatt" wrote in message ... I have code that sets a named range automaticlly now i am trying copy that range to anither sheet in the workbook but everthing i have tried fails. any help would be appriciated thank you in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
jhyatt,
Try Selection.Copy 'copy your range Sheets("Sheet2").Select 'go to the sheet you want Range("A16").Select 'the area to place it ActiveSheet.Paste 'paste "jhyatt" wrote: I have code that sets a named range automaticlly now i am trying copy that range to anither sheet in the workbook but everthing i have tried fails. any help would be appriciated thank you in advance. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
this is the code i am using what i need to do is copy the range and paste to
another sheet. there may be an easier way to accomplish what i am trying to do but this is the only way have found to find all records that contain "promotion" Public Sub AddNamepro(ByVal Promotion As String) Dim wks As Worksheet Dim rngToSearch As Range Dim rngFound As Range Dim rngFoundAll As Range Dim strFirstAddress As String Set wks = ActiveSheet Set rngToSearch = wks.Columns("k") Set rngFound = rngToSearch.find(What:=Promotion, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) If Not rngFound Is Nothing Then Set rngFoundAll = rngFound strFirstAddress = rngFound.Address Do Set rngFoundAll = Union(rngFound, rngFoundAll) Set rngFound = rngToSearch.FindNext(rngFound) Loop Until rngFound.Address = strFirstAddress ThisWorkbook.Names.Add Promotion, rngFoundAll.Address End If "JRForm" wrote: jhyatt, Try Selection.Copy 'copy your range Sheets("Sheet2").Select 'go to the sheet you want Range("A16").Select 'the area to place it ActiveSheet.Paste 'paste "jhyatt" wrote: I have code that sets a named range automaticlly now i am trying copy that range to anither sheet in the workbook but everthing i have tried fails. any help would be appriciated thank you in advance. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
jhyatt,
I am a little confused about your question. You state your looking for any occurance of the word "Promotion" but this code is naming a range "Promotion". What do you want to have happen? If you want to look for the word "promotion" then what do you want to do when it is found? Perhaps copy the entire row of data or maybe selected cells and paste them in a sheet named(??)? "jhyatt" wrote: this is the code i am using what i need to do is copy the range and paste to another sheet. there may be an easier way to accomplish what i am trying to do but this is the only way have found to find all records that contain "promotion" Public Sub AddNamepro(ByVal Promotion As String) Dim wks As Worksheet Dim rngToSearch As Range Dim rngFound As Range Dim rngFoundAll As Range Dim strFirstAddress As String Set wks = ActiveSheet Set rngToSearch = wks.Columns("k") Set rngFound = rngToSearch.find(What:=Promotion, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) If Not rngFound Is Nothing Then Set rngFoundAll = rngFound strFirstAddress = rngFound.Address Do Set rngFoundAll = Union(rngFound, rngFoundAll) Set rngFound = rngToSearch.FindNext(rngFound) Loop Until rngFound.Address = strFirstAddress ThisWorkbook.Names.Add Promotion, rngFoundAll.Address End If "JRForm" wrote: jhyatt, Try Selection.Copy 'copy your range Sheets("Sheet2").Select 'go to the sheet you want Range("A16").Select 'the area to place it ActiveSheet.Paste 'paste "jhyatt" wrote: I have code that sets a named range automaticlly now i am trying copy that range to anither sheet in the workbook but everthing i have tried fails. any help would be appriciated thank you in advance. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
I have a workbook that has a sheet for every day. on the sheets are the
people that have come into the office. some receive promotional prices i am trying to find all entries so i can track the promotions. all entries are in the same column. i want to find all and put them on a totals sheet in the workbook. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
jhyatt,
how many columns do you want for each person put into the summary sheet? If the promotion is found what do we copy over for example, column k = Promotion column j=name columni=time columnh=date columnl=price I would only copy over the neccessary data. "jhyatt" wrote: I have a workbook that has a sheet for every day. on the sheets are the people that have come into the office. some receive promotional prices i am trying to find all entries so i can track the promotions. all entries are in the same column. i want to find all and put them on a totals sheet in the workbook. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range
the way the sheets is set.
column a = name column b = date column c-e = billed column f = rate coulmn g = discount price coulumn k = discount type the only info i would like to bring over would be the name, date, discount price "JRForm" wrote: jhyatt, how many columns do you want for each person put into the summary sheet? If the promotion is found what do we copy over for example, column k = Promotion column j=name columni=time columnh=date columnl=price I would only copy over the neccessary data. "jhyatt" wrote: I have a workbook that has a sheet for every day. on the sheets are the people that have come into the office. some receive promotional prices i am trying to find all entries so i can track the promotions. all entries are in the same column. i want to find all and put them on a totals sheet in the workbook. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Referencing a named range based upon Range name entry in cell | Excel Worksheet Functions | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Compare a selected Range with a Named range and select cells that do not exist | Excel Programming | |||
If any cell in named range = 8 then shade named range | Excel Programming |