sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,404
- Office Version
- 2016
- Platform
- Windows
I've got this which updates a cell with a formula;
This code is repeated through to A31 resulting in a lot of code and I'm trying to create a more efficient method of doing this, so have thought about using a For Loop but don't know how the formula would look.
I know how to do this part;
but don't know how the 'i' part would be written in the next part;
It's probably very straightforward, but only if you know how to do it!
Code:
If Not IsEmpty(Range("A8").Value) Then
Range("D8").Formula = "=A8 & "" "" & C8 & "" "" & B8"
This code is repeated through to A31 resulting in a lot of code and I'm trying to create a more efficient method of doing this, so have thought about using a For Loop but don't know how the formula would look.
I know how to do this part;
Code:
For i = 8 To 31
If Not IsEmpty(Range("A" & i).Value) Then
but don't know how the 'i' part would be written in the next part;
Code:
Range("D8").Formula = "=A8 & "" "" & C8 & "" "" & B8"
It's probably very straightforward, but only if you know how to do it!