Showing posts with label Cell. Show all posts
Showing posts with label Cell. Show all posts

Monday, May 21, 2012

Convert Number to Text

Here are how to convert the existing number to text format in a cell.

1. At the cell, select Format Cells -> tab Number -> select Category = Text
2. At the other cell, type formula =TEXT(X,"0") -> X is refer to the cell which we want to change format, "0" = format text. After that copy this cell and then paste value to the original cell.
3. At the cell, select Data -> Text to Columns -> In the Wizard select Original data type = Delimited -> Next -> Wizard step 2 uncheck all Delimiters -> Next -> Wizard step 3 set Column data format = Text -> Finish

Tuesday, January 24, 2012

Excel VBA command (1)

Cell and Range
  1. Cells.Select -> select all cells in worksheet
  2. Range("A1").Select, Cells(1,1).Select -> select cell A1
  3. Range("A1").Value, Cells(1,1).Value -> return value of cell A1
  4. Rows(1).EntireRow.Select -> select entire row number 1
  5. Columns("A:B").EntireColumn.Select -> select entire column A and B
  6. Selection.CurrentRegion.Select -> select current cell region
  7. ActiveCell.Row, ActiveCell.Column -> return row or column number of active cell
  8. Selection.Rows.Count, Selection.Columns.Count -> return quantity of row or column of selected area
  9. Selection.CurrentRegion.Rows.Count, Selection.CurrentRegion.Columns.Count -> return quantity of row or column of current cell region
  10. Range("A1").Formula = "=B1+B2" -> create a formula =B1+B2 in cell A1
  11. Range("A1").FormulaR1C1 = "=RC[1]+R[1]C[1]" -> create a formula = B1+B2 in cell A1