Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding cells and values

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding cells and values

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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Finding cells and values

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding cells and values

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding cells and values

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding the 3 best values Santafe Excel Worksheet Functions 5 December 6th 09 02:32 PM
Finding Most Recent Values in Col1 -- Summing Matching Values Rothman Excel Discussion (Misc queries) 5 December 20th 07 08:19 PM
Finding most common occurence of values in cells containing letters and numbers sparklyballs Excel Worksheet Functions 2 August 18th 06 12:16 PM
Finding values Chris Lane Excel Worksheet Functions 5 November 19th 05 11:34 AM
finding values and displaying adjacent values willy3211 Excel Worksheet Functions 1 October 12th 05 04:49 PM


All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"