Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to have a macro find a cell and copy it's contents
to a seperate worksheet in the same workbook. The problem I am having is that the cells are not always in the same cell number. They vary on location depending on how much information is placed into a textbox that may contain paragraphs or just one line. So basically, I need it to find out where a column is and copy it. It has to be a macro and I have to have it this way because of backward compatability. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range
set rng = worksheets("Sheet1").Find("abcd") if not rng is nothing then rng.copy Destination:=worksheets("Sheet2").Cells(rows.count ,1).End(xlup)(2) End if -- Regards, Tom Ogilvy "Mike Fenton" wrote in message ... I need to have a macro find a cell and copy it's contents to a seperate worksheet in the same workbook. The problem I am having is that the cells are not always in the same cell number. They vary on location depending on how much information is placed into a textbox that may contain paragraphs or just one line. So basically, I need it to find out where a column is and copy it. It has to be a macro and I have to have it this way because of backward compatability. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to have it find a cell, select that cell and a
range of cells along with it and then copy the selection. That will only select one cell. -----Original Message----- Dim rng as Range set rng = worksheets("Sheet1").Find("abcd") if not rng is nothing then rng.copy Destination:=worksheets("Sheet2").Cells(rows.coun t,1).End (xlup)(2) End if -- Regards, Tom Ogilvy "Mike Fenton" wrote in message ... I need to have a macro find a cell and copy it's contents to a seperate worksheet in the same workbook. The problem I am having is that the cells are not always in the same cell number. They vary on location depending on how much information is placed into a textbox that may contain paragraphs or just one line. So basically, I need it to find out where a column is and copy it. It has to be a macro and I have to have it this way because of backward compatability. . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to have a macro find a cell and copy it's contents
to a seperate worksheet in the same workbook. "find a cell:" sounds like a single cell. Were not clairvoyant. Dim rng as Range, numRows as Long, numColumns as Long numRows = 3 numcolumns = 2 set rng = worksheets("Sheet1").Find("abcd") if not rng is nothing then rng.Resize(numRows,NumColumns).copy _ Destination:=worksheets("Sheet2") _ .Cells(rows.count,1).End (xlup)(2) End if If you want to do a lot of unnecessary selecting so you have really slow code that flashes the screen all over the place to give the impression that your a real amateur, post back. Does that give you any ideas? -- Regards, Tom Ogilvy wrote in message ... I need to have it find a cell, select that cell and a range of cells along with it and then copy the selection. That will only select one cell. -----Original Message----- Dim rng as Range set rng = worksheets("Sheet1").Find("abcd") if not rng is nothing then rng.copy Destination:=worksheets("Sheet2").Cells(rows.coun t,1).End (xlup)(2) End if -- Regards, Tom Ogilvy "Mike Fenton" wrote in message ... I need to have a macro find a cell and copy it's contents to a seperate worksheet in the same workbook. The problem I am having is that the cells are not always in the same cell number. They vary on location depending on how much information is placed into a textbox that may contain paragraphs or just one line. So basically, I need it to find out where a column is and copy it. It has to be a macro and I have to have it this way because of backward compatability. . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yeah, that helps thanks for the advice. Now for you, A
bit of advice. Lighten up chief. -----Original Message----- I need to have a macro find a cell and copy it's contents to a seperate worksheet in the same workbook. "find a cell:" sounds like a single cell. Were not clairvoyant. Dim rng as Range, numRows as Long, numColumns as Long numRows = 3 numcolumns = 2 set rng = worksheets("Sheet1").Find("abcd") if not rng is nothing then rng.Resize(numRows,NumColumns).copy _ Destination:=worksheets("Sheet2") _ .Cells(rows.count,1).End (xlup)(2) End if If you want to do a lot of unnecessary selecting so you have really slow code that flashes the screen all over the place to give the impression that your a real amateur, post back. Does that give you any ideas? -- Regards, Tom Ogilvy wrote in message ... I need to have it find a cell, select that cell and a range of cells along with it and then copy the selection. That will only select one cell. -----Original Message----- Dim rng as Range set rng = worksheets("Sheet1").Find("abcd") if not rng is nothing then rng.copy Destination:=worksheets("Sheet2").Cells (rows.count,1).End (xlup)(2) End if -- Regards, Tom Ogilvy "Mike Fenton" wrote in message ... I need to have a macro find a cell and copy it's contents to a seperate worksheet in the same workbook. The problem I am having is that the cells are not always in the same cell number. They vary on location depending on how much information is placed into a textbox that may contain paragraphs or just one line. So basically, I need it to find out where a column is and copy it. It has to be a macro and I have to have it this way because of backward compatability. . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding the 3 best values | Excel Worksheet Functions | |||
Finding Most Recent Values in Col1 -- Summing Matching Values | Excel Discussion (Misc queries) | |||
Finding most common occurence of values in cells containing letters and numbers | Excel Worksheet Functions | |||
Finding values | Excel Worksheet Functions | |||
finding values and displaying adjacent values | Excel Worksheet Functions |