我从一个论坛上获得了此代码,并且可以正常工作,但是我需要对其进行调整以向我显示“另存为”框,但是我的名字已经用变量FName填充了。
有人可以帮我吗?
Sub Save_New()
Dim FName As String
Dim FPath As String
'FPath = "C:"
FName = Sheets("Sheet1").Range("A1").Text
ThisWorkbook.SaveAs Filename:=FName
End Sub
答案 0 :(得分:1)
您可以为此使用Application.GetSaveAsFilename method…
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<link rel="stylesheet" type="text/css" href="assets/css/reset.css">
<link rel="stylesheet" type="text/css" href="assets/css/main.css">
<link rel="stylesheet" type="text/css" href="assets/css/menu.css">
<link rel="stylesheet" type="text/css" href="assets/css/responsiv.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ahome</title>
</head>
<body>
<!-- <div class="left">
<ul class="nav">
<li><a href="index.html">Hem</a></li>
<li><a href="#produkter">Produkter</a></li>
<li><a href="#nyaprodukter">Nya Produkter</a></li>
</ul>
</div>
<div class="right">
<ul class="nav">
<li><a href="#nyheter">Nyheter</a></li>
<li><a href="#kontakta_info">Kontakta oss/Info</a></li>
<li><a href="#hjälp">Hjälp</a></li>
</ul>
</div>-->
<ul id="ett" class="nav">
<li><a href="index.html">Hem</a></li>
<li><a href="#produkter">Produkter</a></li>
<li><a href="#nyaprodukter">Nya Produkter</a></li>
<li><a href="#nyheter">Nyheter</a></li>
<li><a href="#kontakta_info">Kontakta oss/Info</a></li>
<li><a href="#hjälp">Hjälp</a></li>
</ul>
<img id="bakgrund" src="assets/pictures/homefinal.jpg">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="assets/js/myscript.js"></script>
</body>
</html>