Announcement

Collapse
No announcement yet.

Select only numeric values in a column

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Select only numeric values in a column

    Hi guys, noobie here... I am stuck and would love some input!

    What I have is a column that has several rows of string data, followed by rows of numeric data. The number of rows of numeric and string data may vary from sheet to sheet so I need to be able to find where the string data starts/ends and where the numeric data starts/ends. Any ideas?

    <something along the lines of>

    Code:
    Dim FirstNumeric, i As Integer
    i = 0
    for i = i + 1
        If A_i = string
            Then Next
        If A_i = integer      'or long, whichever works better
            Then A_i = FirstNumeric  'exit loop somehow
        End
    
    'Then take that data and use the first numeric entry in a range and copy it to a new sheet
    
    Range(Range("FirstNumeric").End(xlToRight), Range("A9999").End(xlUp)).Select
        Selection.Copy
        Sheets("New_Sheet").Select
        Range("A1").Select
        ActiveSheet.Paste
        Sheets("Original_Sheet").Select
    Sorry everything is so messy <total noob>

    Thank you so much for your help.

  • #2
    Re: Select only numeric values in a column

    Hey, try the IsNumeric function

    Comment


    • #3
      Re: Select only numeric values in a column

      Thanks! I'll give it a shot

      Comment

      Working...
      X