need help- SUB: DATATYPE FOR A CELL..

  • Thread starter Thread starter monika
  • Start date Start date
M

monika

hi

how should I define the data type of a variable which has
format general in
excel sheet?
The problem is I want to put a value to a few empty columns
of a column
"PL". The occupied cells has a format GENERAL in excel but
they are all
numbers. Also, in the excel sheet, all the occupied cells
show an
exclamation mark (!) error (showing number stored in text).

I defined the value to be put in empty cells as STRING ....
but still when I
see the final output the numbers are all right
aligned...but with GENERAL
format. THE values to be filled in these empty cells are
being taken from
the filled cells of same column.

I think to make all the cells look identical I need to copy
paste rather
than putting the value???
here is that part of code where I put the value from the
specified cell...

Sub finalVal()
Dim v1 As String

If flagrow3 = True Then
With Worksheets(rawDataWorksheetName).Cells(row3, col1)
v1 = .Value
finalValue = v1
End With
End If
If flagrow2 = True Then
With Worksheets(rawDataWorksheetName).Cells(row2, col1)
v1 = .Value
finalValue = v1
End With
End If

End Sub

thanks in advance
monikA
 
Back
Top