Closed Thread
Results 1 to 2 of 2

plz i need ur help! (urgent)

  1. #1
    Registered User
    Join Date
    02-20-2009
    Location
    La, CA
    MS-Off Ver
    Excel 2003
    Posts
    70

    plz i need ur help! (urgent)

    hello everyone


    i have a table like this one :

    A B C D

    1 "Main" | value | value | value
    2 "Extra" | value | value | value
    '
    '
    n "Main" | value | value | value

    i created a macro that deletes the two cells located in column "B" and "C" and shift the value in column "D" to the left whenever in finds "Main" in range("A")
    here's the code he doesn't work properly i don't know why:


    Dim MyColumn As String
    Dim MyRange As Range, MyRange1 As Range
    MyColumn = "A"
    myvalue = "MAIN"
    lastrow = Cells(Rows.Count, MyColumn).End(xlUp).Row
    Set MyRange = Range(MyColumn & "1:" & MyColumn & lastrow)
    For Each c In MyRange
    If (c.Value) = myvalue Then

    'here the code displays an error
    Range("B*:C*").Delete Shift:=xlToLeft
    End If
    Next


    plz help

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: plz i need ur help! (urgent)

    Thread closed for poor title and unwrapped code.

    Please read forum rules below then start a new thread.

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1