You could try selecting the Active Range. That is all the Rows and columns that have Data in them; Then you go to the last used row; In Powershell; $xlCellTypeLastCell = 11 $xl = New-Object -c excel.application $wb = $xl.Workbooks.Open('C:ScriptsBook5.xlsx') # Or in vbScript Const xlCellTypeLastCell = 11 Set oXL = CreateObject ('Excel.Application') oXL.Visible = True oXL.DisplayAlerts = False Set objWorksheet = book1.Worksheets(1) Set objRange = objWorksheet.UsedRange objRange.SpecialCells(xlCellTypeLastCell).Activate intNewRow = oXL.ActiveCell.Row + 1 strNewCell = 'A' & intNewRow oXL.Range(strNewCell).Activate. Columns are numbered, just like rows. Column A is one, B is two and so on. In Excel is Row, Column. So, if you want to write data to Column A you specify: $ws.Cells.Item(1, 1) = “FileName” Which makes Row one Column A equal “FileName”. Names can be used to name MS Excel objects like cells, cell ranges, tables, formulas, constants, etc. These can then be referenced in any other object. Let us further our understanding with the. Autoclicker for mac no trial. $ws.Cells.Item(1, 2) = “Folder” Which makes Row one Column B equal “Folder” # How do I find the last used column number? #This works for columns and rows $mainRng = $ws.UsedRange.Cells $ColCount = $mainRng.Columns.Count $RowCount = $mainRng.Rows.Count $xRow = $RowCount $xCol = $ColCount $xCol is the last used Column. So $ws.Cells.Item(1, $xCol) = “Last Column” Which makes Row one Column? Equal “Last Column”. One of my fingers hit something (a key) and column 'A' disappeared entirely from my document. I have tried 'unhiding' it, I have tried trashing preferences and restarting. I have looked at other documents and find column 'A' fine. The 'B' at the top, labeling column 'B', is colored blue now while all other column labels are grey. Also--column 'A' appears to be recognized by the blue bar at the bottom as it wants to slide over but can't unless forced and the column 'A' notice shows up recognizing it is still there. Also when I search for things on the document I can see the blue box selects info to the side (just barely out of sight)--where column 'A' would be. So, I know the info still exists but it is locked from view. Please help me---I have a 95 page document I am working on and that hidden info is days and days of work. Dan -------------Problems Reply------------ One Option: Select any cell in Column B Key Shift+Command+Home [ fn+Shift+Command+Up Arrow on abbreviated keyboards] Go to Format> Column> Unhide As an alternative to Bob's suggested keyboard shortcut (which I can never remember), you can also type 'A1' (without the quotes) in the Name Box at the left side of the formula bar, hit Return, then choose Format/Column/Unhide. I find that easier to remember. Youtube downloader for mac on safari. One Option: Select any cell in Column B Key Shift+Command+Home [ fn+Shift+Command+Up Arrow on abbreviated keyboards] Go to Format> Column> Unhide As an alternative to Bob's suggested keyboard shortcut (which I can never remember), you can also type 'A1' (without the quotes) in the Name Box at the left side of the formula bar, hit Return, then choose Format/Column/Unhide. I find that easier to remember. Thank you, experts!!! Dan If you had not closed or saved the document when it happens hold down ⌘ and type Y (undo). Category: Views: 1 Time:2012-08-11.
0 Comments
Leave a Reply. |