Edit existing code from a specific cell to active cell

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,785
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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

Forum statistics

Threads
1,224,224
Messages
6,177,268
Members
452,765
Latest member
Erka Gizli

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