Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select Far Right data in a Selected Row


I am very new to Macro's but am trying to modify an existing one inside
a spreadsheet I have to update.

What I have to do is select a range of cells in one row, i.e. D21:DX21.
I want to take the data from the farthest right cell in that range that
contains data, and place that value in B21.

Hopefully this is a simple request!!

Thanks in advance for any help I can get!


--
tmony
------------------------------------------------------------------------
tmony's Profile: http://www.excelforum.com/member.php...o&userid=28966
View this thread: http://www.excelforum.com/showthread...hreadid=537773

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Select Far Right data in a Selected Row

I assume you mean with code and not formulas?

Dim rng as Range
set rng = Range("DX21")
if isempty(rng) then
set rng = rng.End(xltoLeft)
end if
if rng.Column = 4 then
Range("B21").Value = rng.Value
else
Msgbox "Range of interest is empty"
End if

--
Regards,
Tom Ogilvy




"tmony" wrote:


I am very new to Macro's but am trying to modify an existing one inside
a spreadsheet I have to update.

What I have to do is select a range of cells in one row, i.e. D21:DX21.
I want to take the data from the farthest right cell in that range that
contains data, and place that value in B21.

Hopefully this is a simple request!!

Thanks in advance for any help I can get!


--
tmony
------------------------------------------------------------------------
tmony's Profile: http://www.excelforum.com/member.php...o&userid=28966
View this thread: http://www.excelforum.com/showthread...hreadid=537773


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
List to select up to 6 selected responses Ellen Excel Discussion (Misc queries) 4 May 12th 07 05:20 PM
sheet protection - only selected range to be able to select/input data Corey Excel Worksheet Functions 7 February 13th 07 05:41 PM
Select the last Cell of a selected Cellarea Ben Excel Programming 4 June 22nd 05 01:35 PM
Can you select a chart but not see it's selected? Mark Stephens Charts and Charting in Excel 1 May 8th 05 08:17 AM
How do I de-select a selected row? Suze Excel Discussion (Misc queries) 1 April 25th 05 05:10 PM


All times are GMT +1. The time now is 04:23 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"