Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JR JR is offline
external usenet poster
 
Posts: 92
Default select entire row from a lookup

I need to allow users to make a selection from a dropdown then I want code to
select the entire row (in this instance A throuhg J), copy the row and paste
it into a customizable list.

Can anyone tell me how to select an entire row in that manner?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select entire row from a lookup


Depending on your dropdown cell something like:

Dim oCell As String
oCell = Sheets("Sheet1").Range("A1").Value 'change to suit the
dropdown
'assuming dropdown has Cell addresses
Range(Cells(Range(oCell).Row, 1), Cells(Range(oCell).Row, 10)).Copy _
Destination:=Sheets("Sheet2").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)

The above code copies the data from columns A - J for the specified
row, so if the value of A1 was AZ22 the code will copy A22:J22 to the
next available row on sheet 2.


--
The Code Cage Team

Regards,
The Code Cage Team
www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=7117

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default select entire row from a lookup

What is in the dropdown? Your subject line mentioned "lookup"... are you
trying to lookup what the user picked? Is so, where did you want to look
at... a column, a row, a range of cells? You mention that you want to select
and then copy... odds are you do not have to select to do your copy, but to
know for sure, you need to tell us about your "customizable list". Where
and/or what is it... an array in memory, a String variable, a range of
cells, something else? The more details you tells us, the better answer one
of us will be able to provide for you.

--
Rick (MVP - Excel)


"JR" wrote in message
...
I need to allow users to make a selection from a dropdown then I want code
to
select the entire row (in this instance A throuhg J), copy the row and
paste
it into a customizable list.

Can anyone tell me how to select an entire row in that manner?

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.programming
JR JR is offline
external usenet poster
 
Posts: 92
Default select entire row from a lookup



"Rick Rothstein" wrote:

What is in the dropdown?


it is a dropdown from a list

Your subject line mentioned "lookup"... are you
trying to lookup what the user picked? Is so, where did you want to look
at... a column, a row, a range of cells?


The list is "looking" at a column.

You mention that you want to select
and then copy... odds are you do not have to select to do your copy, but to
know for sure, you need to tell us about your "customizable list". Where
and/or what is it... an array in memory, a String variable,


a range of cells, the row of which the lookup column selected cell is
located

something else? The more details you tells us, the better answer one
of us will be able to provide for you.

--
Rick (MVP - Excel)


"JR" wrote in message
...
I need to allow users to make a selection from a dropdown then I want code
to
select the entire row (in this instance A throuhg J), copy the row and
paste
it into a customizable list.

Can anyone tell me how to select an entire row in that manner?

Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default select entire row from a lookup

Hello JR,

I have the same problem and I'm still looking for the best way to do this,
did you find a way to do it? does that code from thecodecage work? Please
reply
--
Cesar


"JR" wrote:

I need to allow users to make a selection from a dropdown then I want code to
select the entire row (in this instance A throuhg J), copy the row and paste
it into a customizable list.

Can anyone tell me how to select an entire row in that manner?

Thanks.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default select entire row from a lookup


The Code Cage Team;23733 Wrote:
Depending on your dropdown cell something like:

Dim oCell As String
oCell = Sheets("Sheet1").Range("A1").Value 'change to suit the
dropdown
'assuming dropdown has Cell addresses
Range(Cells(Range(oCell).Row, 1), Cells(Range(oCell).Row, 10)).Copy _
Destination:=Sheets("Sheet2").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)

The above code copies the data from columns A - J for the specified
row, so if the value of A1 was AZ22 the code will copy A22:J22 to the
next available row on sheet 2.

Did this not work for you?


--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=7117

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
Select Entire Row if Text is Red ryguy7272 Excel Programming 3 November 2nd 07 06:52 PM
Select the entire row shantanu oak Excel Discussion (Misc queries) 5 July 17th 06 11:34 AM
select cell rather selecting entire row ilyaskazi[_99_] Excel Programming 1 November 25th 05 02:48 PM
How to select entire column using VBA Phill Excel Programming 3 December 5th 03 03:44 PM
select contents of entire worksheet Dave[_22_] Excel Programming 5 August 1st 03 04:17 PM


All times are GMT +1. The time now is 01:45 AM.

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

About Us

"It's about Microsoft Excel"