Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should be a simple fix for you guys!
After i go "xlDown", how do i maintain the same cell range in the C column when i move over one column? In Excel, i would do the following... in Starting in D6... Ctrl+Shft+Dwn, Shft+Left+Tab+Lft how do i translate into code? eg. "xlDown" in the below code highlights D6:D?... Now i want the same range highlighted in column C =, not D. Range("D6").Select Range(Selection, Selection.End(xlDown)).Select Range("C6:C1260").Select ExcelJockey *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should work
Range(Selection.Offset(0, -1), Selection.End(xlDown).Offset(0, -1)).Select "Kirill V" wrote: This should be a simple fix for you guys! After i go "xlDown", how do i maintain the same cell range in the C column when i move over one column? In Excel, i would do the following... in Starting in D6... Ctrl+Shft+Dwn, Shft+Left+Tab+Lft how do i translate into code? eg. "xlDown" in the below code highlights D6:D?... Now i want the same range highlighted in column C =, not D. Range("D6").Select Range(Selection, Selection.End(xlDown)).Select Range("C6:C1260").Select ExcelJockey *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked great, thanks guys!
ExcelJockey *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Selection.Offset(0,-1).Select But don't use select unless it is needed. The code below is doing what your are trying to do: Dim FirstCell As Range Set FirstCell = Range("D6") Set TargetRange = Range(FirstCell, FirstCell.End(xlDown)) TargetRange.Offset(0, -1).Select Hopes this helps. --- Per "Kirill V" skrev i meddelelsen ... This should be a simple fix for you guys! After i go "xlDown", how do i maintain the same cell range in the C column when i move over one column? In Excel, i would do the following... in Starting in D6... Ctrl+Shft+Dwn, Shft+Left+Tab+Lft how do i translate into code? eg. "xlDown" in the below code highlights D6:D?... Now i want the same range highlighted in column C =, not D. Range("D6").Select Range(Selection, Selection.End(xlDown)).Select Range("C6:C1260").Select ExcelJockey *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
OFFSET COLUMN() ROW() - what does this mean? | Excel Worksheet Functions | |||
offset row not column | Excel Programming | |||
Countif from an offset column | Excel Worksheet Functions | |||
Offset from a variable column to a fixed column | Excel Programming | |||
offset every nth column | Excel Worksheet Functions |