我正在尝试搜索已经创建的名称为TextBox1.Value
的工作表。然后在名为“雇员列表”的工作表上找到相同的名称,然后将该单元格超链接到具有相同名称的工作表。
它试图链接到我正在使用的文件夹内的“名称”。它甚至没有到达工作簿内。我是否缺少.Hyperlinks
中的参数?
Dim findEmployee As Range
Dim foundEmployee As Range
Set findEmployee = Sheets("Employee List").Range("A:A")
Set foundEmployee = findEmployee.Find(TextBox1.Value)
With Worksheets("Employee List")
.Hyperlinks.Add
Anchor:=.Range(foundEmployee.Address), _ Address:=Worksheets(TextBox1.Value).Range("A1"), _
TextToDisplay:=TextBox1.Value
End With
答案 0 :(得分:1)
您可以试试吗?记录宏时,将使用子地址而不是address参数,并且该子地址必须为字符串形式,而不是范围形式。如果工作表名称中包含空格,则需要在字符串中添加单引号。
private readonly SignInManager<IdentityUser> _signInManager;
private readonly ILogger<LogoutModel> _logger;
private readonly IIdentityServerInteractionService _interaction;
public LogoutModel(SignInManager<IdentityUser> signInManager, ILogger<LogoutModel> logger,
IIdentityServerInteractionService interaction)
{
_signInManager = signInManager;
_logger = logger;
_interaction = interaction;
}
public async Task<IActionResult> OnGet(string logoutId)
{
return await OnPost(logoutId);
}
public async Task<IActionResult> OnPost(string logoutId)
{
await _signInManager.SignOutAsync();
_logger.LogInformation("User logged out.");
var r = await _interaction.GetLogoutContextAsync(logoutId);
if (r.PostLogoutRedirectUri == null)
{
return Redirect("/");
}
return Redirect(r.PostLogoutRedirectUri);
}