![]() |
|
#1
|
|||
|
|||
![]() Hello, I’m using the Excel shortcut keys Ctrl+Shift+Down to select all of the consecutive cells with data down a column starting with the cell that is originally selected. This could be anywhere from 1 to 100 cells. The data in these cells is generated from a formula. Z2 is =TRIM(X2), Z3 is =TRIM(X3), Z4 is =TRIM(X4) and so on. If I have data in say Z2-Z6 I want the Excel shortcut to select those cells. The problem is, cells Z7 and downward still have the formula (but no data) and I believe for this reason the XL shortcut is selecting those cells also which I don’t want. Is there with a way to work around this? Thanks |
#2
|
|||
|
|||
![]()
Yes, as far as excel is concerned there is data in the cells and therefore its a continuous range.
Assuming that x is only populated X2 to X6 (which is why z7 onwards is blank), as i a bit of a work around.
|
#3
|
|||
|
|||
![]()
Hello, Thanks for the response here. I’ve been experimenting here with your solution but I’m still having a few issues. I used X and Z for examples for the columns where in reality they are AW and G so it takes some time to arrow to the desired column. Also, in my column X (in the X,Z example) everything in column X is also populated from a formula so I have the same issue here. Is there possibly another method? Basically what I want to do is select all the cells in a particular column that appear to have data so some script I'm running can copy it for something in another program. I do not want to include the cells that appear to have no data even though the cell has a TRIM formula that could populated it another scenario. The data in each of the sales that I want to select/copy contains numbers and letters if that matters. Thanks
|
#4
|
|||
|
|||
![]()
Yes, if the columns are far apart its an issue i agree. I must admit i dont know an easy way of selected just the cells with nothing showing
Can do it with a few lines of VBA, maybe assigned to f12? but that might be overkill - it just selects at the monment but could be changed to copy Sub selectnCopypop() Dim r As String Dim rRow As Integer r = ActiveCell.Address rRow = ActiveCell.Row Do While ActiveCell.Offset(rRow, 0) <> "" rRow = rRow + 1 Loop Range(r).Resize(rRow, 1).Select End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
asearle | Word | 8 | 08-07-2012 08:07 AM |
![]() |
tinfanide | Word VBA | 2 | 12-05-2011 03:41 AM |
Shortcut keys in Find&Replace | fsdance | Word | 0 | 02-11-2011 03:27 PM |
cant use shortcut keys (ctrl+c/v/z...) | laro | Office | 0 | 10-08-2010 11:01 PM |
Can't Assign Shortcut Keys | Vicki F. | Word | 0 | 04-17-2010 03:03 PM |