Consider the following toy example based on your variable names:
clear
set obs 1
forvalues i = 11 / 15 {
generate hv101_`i' = rnormal()
label variable hv101_`i' ExampleVarLabel
}
describe, fullnames
Contains data
obs: 1
vars: 5
size: 20
-------------------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-------------------------------------------------------------------------------------------------------------------------------------
hv101_11 float %9.0g ExampleVarLabel
hv101_12 float %9.0g ExampleVarLabel
hv101_13 float %9.0g ExampleVarLabel
hv101_14 float %9.0g ExampleVarLabel
hv101_15 float %9.0g ExampleVarLabel
-------------------------------------------------------------------------------------------------------------------------------------
Sorted by:
Note: Dataset has changed since last saved.
The following then works for me:
foreach v of var * {
local lbl : variable label `v'
rename `v' `lbl'`=substr("`v'", strpos("`v'", "_"), .)'
label variable `lbl'`=substr("`v'", strpos("`v'", "_"), .)' `v'
}
describe, fullnames
Contains data
obs: 1
vars: 5
size: 20
-------------------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-------------------------------------------------------------------------------------------------------------------------------------
ExampleVarLabel_11
float %9.0g hv101_11
ExampleVarLabel_12
float %9.0g hv101_12
ExampleVarLabel_13
float %9.0g hv101_13
ExampleVarLabel_14
float %9.0g hv101_14
ExampleVarLabel_15
float %9.0g hv101_15
-------------------------------------------------------------------------------------------------------------------------------------
Sorted by:
Note: Dataset has changed since last saved.
EDIT:
If the labels are the same and the variable numbering sequential, you do not even need a loop:
local lbl : variable label hv101_11
rename hv101_* `lbl'_#, renumber(11)