Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
supplimental select cells in first row with data in cells(data not in all cells). lc = Cells(1, Columns.Count).End(xlToLeft).Column Range(Cells(1, 1), Cells(1, lc)).Select" select cells in last row with data in cells(data not in all cells). lc = Cells(1, Columns.Count).End(xlToLeft).Column lr = Cells(Rows.Count, "A").End(xlUp).Row Range(Cells(lr, 1), Cells(lr, lc)).Select lot of ways to do this. regards FSt1 FSt1" wrote: hi select first and last row. select first row......entire row Range("A1").EntireRow.Select select cells in first row with data in cells(assumes a solid row of data). Range(Range("A1"), Range("A1").End(xlToRight)).Select select last row - entire row lr = Cells(Rows.Count, "A").End(xlUp).Row Rows(lr).EntireRow.Select select cells in last row with data in cells(assumes a solid row of data). lr = Cells(Rows.Count, "A").End(xlUp).Row Range(Range("A" & lr), Range("A" & lr).End(xlToRight)).Select Regards FSt1 "Stephan Leduc" wrote: Hello, I have a sub & function where I email the First (column headers) and Last Row of the Sheet. (Sheetname=VoiceMailData) The email is working, and copying the data works fine. I just can't select the First and Last Row. I have 12 columns. Here is my code: Set rng = Nothing On Error Resume Next 'Only the visible cells in the selection Set rng = Cells(Rows.Count, "A").End(xlUp).Row 'You can also use a range if you want 'Set rng = Sheets("YourSheet").Range("D4:D12").SpecialCells(x lCellTypeVisible) On Error GoTo 0 Thanks Stephan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Alternate Row Select in Sheet 1 then Paste to Sheet 2 | Excel Worksheet Functions | |||
Select sheet, Pause till Enter pressed, return to previous sheet | Excel Programming | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
Use of Sheet CodeNames to Select Sheet in Different Workbook | Excel Programming | |||
Select Sheet then Select Range | Excel Programming |