简体   繁体   English

根据用户输入的另一个单元格填充单元格的一部分

[英]Populate a portion of a cell based off another cells user input

Hello All wanted to start off by saying I appreciate your input and help.大家好,首先要说我感谢您的投入和帮助。 I'm not familiar with VB and so I am wondering if this can even be done in Excel.我不熟悉 VB,所以我想知道这是否可以在 Excel 中完成。 I have five columns that I would like populate based off a value entered off of another field.我有五列,我想根据从另一个字段输入的值填充这些列。 These are IP addresses, but the 2nd and 3rd octet will be variable.这些是 IP 地址,但第二个和第三个八位字节是可变的。 Each of the five columns will also have a different 4th octet but it is static to the column.五列中的每一列也将具有不同的第 4 个八位字节,但它对列来说是静态的。

Example:

IP is 10.20.40.1 (This IP is Variable, each row would have a different value, so row 2 would be 10.20.41.1, and so forth.)

Column 1 = 10.20.40.0/28
Column 2 = 10.20.40.67/32
Column 3 = 10.20.40.65/32
Column 4 = 10.20.40.0/24

So the 4th octet of each column will always stay the same, what I would like the user to be able to do is enter in 10.20.40.1 into Column 0 which would then populate Column 1-4 with the IP's I need to have.所以每列的第 4 个八位字节将始终保持不变,我希望用户能够做的是将 10.20.40.1 输入到第 0 列,然后用我需要的 IP 填充第 1-4 列。 I know I could do this by using 4 columns and then running a CONCENTATE but that would kind of defeat the purpose of the user inputting the raw data.我知道我可以通过使用 4 列然后运行 ​​CONCENTATE 来做到这一点,但这会破坏用户输入原始数据的目的。

Is their a way to accomplish just with VLOOKUP?他们是仅使用 VLOOKUP 就可以完成的方法吗? or Would I need to research VB and write something that could handle this?或者我是否需要研究 VB 并编写一些可以处理这个问题的东西?

Again thank you for taking the time to look at this!再次感谢您花时间看这个!

想通了,我可以使用 =SUBSTITUTE 来替换值,而不是尝试替换第二个或第三个八位字节,我可以使用该公式转换第四个八位字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM