简体   繁体   中英

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. 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. Each of the five columns will also have a different 4th octet but it is static to the column.

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. 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.

Is their a way to accomplish just with VLOOKUP? or Would I need to research VB and write something that could handle this?

Again thank you for taking the time to look at this!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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