Macro_Loop

zinah

Board Regular
Joined
Nov 28, 2018
Messages
179
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have set of goals for each employee and I need to set 5 loops to include them, below is the macro that went through one goal. I need to set loop to go through all the 5 goals, how can I do that?

objLbl = "Objective: " & Chr(10) outLbl = "Metrics/Outcomes: " & Chr(10)
objTxt = ActiveSheet.[Obej_Col].Offset(1, 0).Value
outTxt = ActiveSheet.[Met_Col].Offset(1, 0).Value
catTxt = "Core Responsibilities"
prgLbl = "Progress: "
prgTxt = ActiveSheet.[Prog_Col].Offset(1, 0).Value

Thank you!
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
Try this.
The data in blue are the modified ones.

Code:
[B][COLOR=#0000ff]    For i = 1 To 5[/COLOR][/B]
        objLbl = "Objective: " & Chr(10)
        outLbl = "Metrics/Outcomes: " & Chr(10)
        objTxt = ActiveSheet.[Obej_Col].Offset([B][COLOR=#0000ff]i[/COLOR][/B], 0).Value
        outTxt = ActiveSheet.[Met_Col].Offset([B][COLOR=#0000ff]i[/COLOR][/B], 0).Value
        catTxt = "Core Responsibilities"
        prgLbl = "Progress: "
        prgTxt = ActiveSheet.[Prog_Col].Offset([B][COLOR=#0000ff]i[/COLOR][/B], 0).Value
[B][COLOR=#0000ff]    Next[/COLOR][/B]
 

Watch MrExcel Video

Forum statistics

Threads
1,108,911
Messages
5,525,593
Members
409,653
Latest member
rishir

This Week's Hot Topics

Top