Showing posts with label values. Show all posts
Showing posts with label values. Show all posts

August 10, 2018

Microsoft Excel Copy row values to another sheet next available row when the value changes

Hi friends,

My friend had given me a problem in excel of copy row whenever the values changed to another sheet next available row.

I have come-up with this following code

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Target.ActiveSheet.Range("A1:D1")) Is Nothing Then
        Application.EnableEvents = False
        Application.ScreenUpdating = False
        MsgBox ("Hi")
        Call ValueChange
        Application.EnableEvents = True
    End If
End Sub
Sub ValueChange()
        Dim lastrow As Long
        
        lastrow = Sheets("Sheet2").Range("A65536").End(xlUp).Row + 1
        Sheets("Sheet2").Range("A" & lastrow & ": D" & lastrow).Value = Sheets("Sheet1").Range("A1:D1").Value

End Sub

Hope it will help you.

Note:
Please share your valuable comments and feedback to psrdotcom@gmail.com

February 06, 2016

Microsoft Excel Select a value from a predefined list of values with dropdown option to validate the data

Hi friends,

When I was preparing a sheet by referencing some pre-defined names as list to a field/cell. I was thinking the feature of Microsoft Excel dropdown list. After exploring the option and using, I thought of sharing with you all.

Objective: Selecting a cell value from a list of pre-defined values

Procedure:
  1. Open blank excel workbook
  2. Prepare you template with headers
  3. Create a new sheet and rename it. Ex: "Names"
  4. Enter the values from Column A from cell A1 in vertical direction
  5. Don't use any other columns
  6. Don't leave any empty cell in between the values
  7. Leave first cell as empty, if you want to include the empty option in a dropdown
  8. Select the cell which contains the values
  9. Right click and choose the option "Define Name"
  10. Give a name to the list of values. Ex: NamesList
  11. Click on "OK" button
  12. Now, move to the sheet where we want to use the list of names as a dropdown option
  13. Select the cell(s), where we want to have the dropdown list
  14. Click on "Data" Menu
  15. From "Data Tools" ribbon, click "Data Validation" from "Data Validation" submenu
  16. In Settings tab, Validation Criteria section, for the option Allow, select "List"
  17. Choose the options
    • Ignore blank: Ignore when user no selected any option
    • In-cell Dropdown: Show the dropdown list in cell
  18. In "Source" field, type the defined name for the list preceded with = (Equal to) symbol. Ex: =NamesList
  19. Now, you should be able to see the dropdown with empty values
  20. Select the predefined values from the dropdown list of names.
Please send your comments and feedback to psrdotcom@gmail.com

    Featured Post

    Java Introdcution

    Please send your review and feedback to psrdotcom@gmail.com