Edit existing code from a specific cell to active cell

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,
Not sure if my tital explains it correctly.
I was using a code that automatically cell P5 but now working on chaning the code.
In the code below you will see the offset code with then selects the cell in column P

Can you advise how i now edit the code to remove P5 to the cell in question as the cell will be anythingt now in column P

Rich (BB code):
    With Sheets("DATABASE")
    cell.Select
    ActiveCell.Offset(0, 15).Select
    End With
        If Trim(destWS.Range("P5").Value) <> "" Then
      MsgBox ("THE CELL HAS A INVOICE NUMBER IN IT ALREADY"), vbCritical, "CELL P ISNT EMPTY MESSAGE"
      
    Call KILLINVOICE
          
    With Sheets("INV")
      Worksheets("DATABASE").Activate
      Worksheets("DATABASE").Range("P5").Select
    End With
    
    Exit Sub
    Else
      srcWS.Range("L4").Copy destWS.Range("P5")

    With destWS
      .Range("P5").Font.Size = 14
      .Activate
      .Range("P5").Select
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,
I have changed the code to remove P5 to the advised but i now see the changed text in Red.


Rich (BB code):
If Trim(destWS.Range("P5").Value) <> "" Then

TO

Rich (BB code):
If Trim(destWS.Range) Active cell.value <> "" Then

AND

Rich (BB code):
srcWS.Range("L4").Copy destWS.Range("P5")

TO

Rich (BB code):
srcWS.Range("L4").Copy destWS.Range Activecell.value
 
Upvote 0
Any it advise please how I correctly fix the above.
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,148
Members
449,098
Latest member
Doanvanhieu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top