Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Value Of Last Cell
Hi: I'm modifying someone else's macro (which works fine) to instead of inserting the cheet name to sort it, it would insert the value of the last cell in column B this is part of that macro Sub SortALLSheets() ' Dim WB As Workbook Dim ws As Worksheet Dim rng As Range Dim cSheets As Integer Dim sSheets() As String Dim i As Integer ' Set WB = ActiveWorkbook 'get true array dimension cSheets = WB.Sheets.Count ReDim sSheets(1 To cSheets) 'fill array with worksheet names ' For i = 1 To cSheets 'sSheets(i) = WB.Sheets(i).Name sSheets(i) = Range("B65536").End(xlUp).Select ------HERE 'Selection.Copy Next Set ws = WB.Worksheets.Add 'create new sheet and put names in first column ' For i = 1 To cSheets ws.Cells(i, 1).Value = sSheets(i) Next |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell | Excel Worksheet Functions | |||
I copy a formula and the results copy from the original cell | Excel Discussion (Misc queries) | |||
VBA to copy to empty cell directly below a cell when analogous cells in different column have same value as each other? | Excel Programming |