Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
List to select up to 6 selected responses | Excel Discussion (Misc queries) | |||
sheet protection - only selected range to be able to select/input data | Excel Worksheet Functions | |||
Select the last Cell of a selected Cellarea | Excel Programming | |||
Can you select a chart but not see it's selected? | Charts and Charting in Excel | |||
How do I de-select a selected row? | Excel Discussion (Misc queries) |