+ Reply to Thread
Results 1 to 3 of 3

modification to existing code to If statement

Hybrid View

  1. #1
    JOUIOUI
    Guest

    modification to existing code to If statement

    I use this code to move amounts from column K (11) to column G in the same
    row and then delete the contents in the cell in column K. My problem is that
    I get an error if there is not amounts in column K. I'm not sure how I would
    alter this to say if there is text in col K move it to column G so I don't
    get the soft edit. Any ideas. Thank you


    Set rng = Columns(11).SpecialCells(xlConstants)
    For Each Cell In rng
    Cells(Cell.Row, "G").Value = Cell.Value
    Next
    rng.ClearContents

  2. #2
    Don Guillett
    Guest

    Re: modification to existing code to If statement

    try
    on error resume next

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "JOUIOUI" <JOUIOUIM@Discussions.microsoft.com> wrote in message
    news:A04EF2CC-DB78-41D8-B270-B22670DFB0A6@microsoft.com...
    >I use this code to move amounts from column K (11) to column G in the same
    > row and then delete the contents in the cell in column K. My problem is
    > that
    > I get an error if there is not amounts in column K. I'm not sure how I
    > would
    > alter this to say if there is text in col K move it to column G so I don't
    > get the soft edit. Any ideas. Thank you
    >
    >
    > Set rng = Columns(11).SpecialCells(xlConstants)
    > For Each Cell In rng
    > Cells(Cell.Row, "G").Value = Cell.Value
    > Next
    > rng.ClearContents




  3. #3
    JOUIOUI
    Guest

    Re: modification to existing code to If statement

    Where in my code to I put that text Don. I've tried in various places but I
    still ge the debug error. I appreciate your help thanks

    "Don Guillett" wrote:

    > try
    > on error resume next
    >
    > --
    > Don Guillett
    > SalesAid Software
    > dguillett1@austin.rr.com
    > "JOUIOUI" <JOUIOUIM@Discussions.microsoft.com> wrote in message
    > news:A04EF2CC-DB78-41D8-B270-B22670DFB0A6@microsoft.com...
    > >I use this code to move amounts from column K (11) to column G in the same
    > > row and then delete the contents in the cell in column K. My problem is
    > > that
    > > I get an error if there is not amounts in column K. I'm not sure how I
    > > would
    > > alter this to say if there is text in col K move it to column G so I don't
    > > get the soft edit. Any ideas. Thank you
    > >
    > >
    > > Set rng = Columns(11).SpecialCells(xlConstants)
    > > For Each Cell In rng
    > > Cells(Cell.Row, "G").Value = Cell.Value
    > > Next
    > > rng.ClearContents

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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