how do I make code more readable ?

hi Experts
I have a really long line of code:

sheets("Personal Format Presentation").Range("B21").value = Range("A21").value & " " & Range("C21").value & Range("D21").value

How Can I make this easier to read ?

Hope that makes sense !

Sandra

Nick's picture

hi Sandra.. there are a few

hi Sandra.. there are a few things you can do.. these are prob the best:

1. Use line continuation:

sheets("Personal Format Presentation").Range("B21").value = _
 Range("A21").value & " " & Range("C21").value & Range("D21").value

2. Split up into more lines:

set PFP = sheets("Personal Format Presentation")
Variable1 = Range("A21").value
Variable2 = Range("C21").value
Variable3 = Range("D21").value
 
PFP.Range("B21").value = Variable1 & " " & Variable2 & Variable3

Nick