[AccessD] (OT) Excel VBA question

Oleg_123 at xuppa.com Oleg_123 at xuppa.com
Tue May 18 14:10:55 CDT 2004


ok, i will
meanwhile i wrote this lovely piece, which froze my excel :--)

Sub CheckFirst4chars()
Dim First4 As String
Dim f, n
  Range("A1").EntireRow.Select
    Do While ActiveCell.Value <> " "
        f = ActiveCell.Row
        n = "B" & f
        If Left(ActiveCell.Value, 2) = "XX" Then
        Range(n).Value = "XXXX"

        ElseIf Left(ActiveCell.Value, 2) = "YY" Then
         Range(n).Value = "YYYY"
        End If
    Loop
 End Sub


>
> Try this:
>
> If Left(ActiveCell.Value, 2) = "XX" Then
>         Activecell.offset(0,1).select 'same cell coumn B = "XXXX"
>         Activecell.value = "XXXX"
>         Activecell.offset(0,-1)
> ElseIf Left(ActiveCell.Value, 2) = "YY" Then
>         Activecell.offset(0,1).select 'same cell coumn B = "YYYY"
>         Activecell.value = "YYYY"
>         Activecell.offset(0,-1)
>
> End If
>
>
>
>                       Oleg_123 at xuppa.com
>
>                     Sent by:
>   To:       accessd at databaseadvisors.com
>
> accessd-bounces at databasea        cc:
>
>                     dvisors.com
>   Subject:  [AccessD] (OT) Excel VBA question
>
>
>
>                       05/18/2004 01:56 PM
>
>                     Please respond to "Access
>
>                                         Developers
> discussion and
>
>          problem solving"
>
>
>
>
>
>
>
>
> sorry for posting excel question,
> does anyone know how i can fix this so it would post required strings in
> Column B for the same row ?
> Oleg
>
> Sub CheckFirst4chars()
> Dim First4 As String
>   Range("A1").EntireRow.Select
>     Do While ActiveCell.Value <> " "
>         If Left(ActiveCell.Value, 2) = "XX" Then
>          'same cell coumn B = "XXXX"
>         ElseIf Left(ActiveCell.Value, 2) = "YY" Then
>          'same cell coumn B = "YYYY"
>         End If
>     Loop
>  End Sub
>
>
>
> -----------------------------------------
> Get the BUZZ on your Friends, Relatives and Celebrities:
> www.xuppa.com/buzz/?link=webmail
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
>
>
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



-----------------------------------------
Get the BUZZ on your Friends, Relatives and Celebrities:
www.xuppa.com/buzz/?link=webmail





More information about the AccessD mailing list