Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Filling in columns counting by Hex

3 columns:
A B C
042-0-0-01234 100.100.1.210 00-00-00-00-04-D2

I will have a list in column A, numerical...042-0-0-01234,042-0-0-01235, etc
Column C will have a MAC and the last 2 segments are based on the last 5 of
column A. e.g. 01234 = 04D2 (first 4 segments are fixed)
Column B is decimal of last segment of column C, e.g. D2 = 210

I would like to scroll down column A, and fill in column B anc C, which I am
doing manual right now.

Way beyond me.....Any ideas?

Thanks,
Ron
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Filling in columns counting by Hex

Oh yeah...if it could go down a certain number of rows, which I would tell
it, or until it hit a filled cell in Column B or C...that would help.

Thanks, wizards

"Ron" wrote:

3 columns:
A B C
042-0-0-01234 100.100.1.210 00-00-00-00-04-D2

I will have a list in column A, numerical...042-0-0-01234,042-0-0-01235, etc
Column C will have a MAC and the last 2 segments are based on the last 5 of
column A. e.g. 01234 = 04D2 (first 4 segments are fixed)
Column B is decimal of last segment of column C, e.g. D2 = 210

I would like to scroll down column A, and fill in column B anc C, which I am
doing manual right now.

Way beyond me.....Any ideas?

Thanks,
Ron

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Filling in columns counting by Hex

Hi Ron,

Assuming that the first value is in A2 insert the following formulas.

In C2 enter
="00-00-00-00-"&LEFT(DEC2HEX(RIGHT(A2,5),4),2)&"-"&RIGHT(DEC2HEX(RIGHT(A2,5),4),2)

In B2 enter ="100.100.1."&HEX2DEC(RIGHT(C2,2))

Copy the formulas down the columns.

--
Regards,

OssieMac


"Ron" wrote:

Oh yeah...if it could go down a certain number of rows, which I would tell
it, or until it hit a filled cell in Column B or C...that would help.

Thanks, wizards

"Ron" wrote:

3 columns:
A B C
042-0-0-01234 100.100.1.210 00-00-00-00-04-D2

I will have a list in column A, numerical...042-0-0-01234,042-0-0-01235, etc
Column C will have a MAC and the last 2 segments are based on the last 5 of
column A. e.g. 01234 = 04D2 (first 4 segments are fixed)
Column B is decimal of last segment of column C, e.g. D2 = 210

I would like to scroll down column A, and fill in column B anc C, which I am
doing manual right now.

Way beyond me.....Any ideas?

Thanks,
Ron

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Filling in columns counting by Hex

You didn't tell us how the front part of the values in Columns B and C are
specified, so I hard-coded what you showed us into the following macro (you
will have to adjust this on your own or tell us how this information is
derived so we can show you how to do it). Also your specification on which
cells to operate on was kind of sketchy, so I took the easy way out and
simply made the code operate on each cell in the current selection...

Sub HexSplitter()
Dim Cell As Range, HexNum As String
For Each Cell In Selection
HexNum = Right("0000" & Hex(Right(Cell.Value, 5)), 4)
Cell.Offset(0, 1).Value = "100.100.1." & CLng("&H" & Right(HexNum, 2))
Cell.Offset(0, 2).Value = "00-00-00-00-" & Format(HexNum, "@@-@@")
Next
End Sub

--
Rick (MVP - Excel)



"Ron" wrote in message
...
Oh yeah...if it could go down a certain number of rows, which I would tell
it, or until it hit a filled cell in Column B or C...that would help.

Thanks, wizards

"Ron" wrote:

3 columns:
A B C
042-0-0-01234 100.100.1.210 00-00-00-00-04-D2

I will have a list in column A, numerical...042-0-0-01234,042-0-0-01235,
etc
Column C will have a MAC and the last 2 segments are based on the last 5
of
column A. e.g. 01234 = 04D2 (first 4 segments are fixed)
Column B is decimal of last segment of column C, e.g. D2 = 210

I would like to scroll down column A, and fill in column B anc C, which I
am
doing manual right now.

Way beyond me.....Any ideas?

Thanks,
Ron


  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Filling in columns counting by Hex

Sorry guys, I've been away...thanks for the responses, I'll see what works
and let you know.

"Rick Rothstein" wrote:

You didn't tell us how the front part of the values in Columns B and C are
specified, so I hard-coded what you showed us into the following macro (you
will have to adjust this on your own or tell us how this information is
derived so we can show you how to do it). Also your specification on which
cells to operate on was kind of sketchy, so I took the easy way out and
simply made the code operate on each cell in the current selection...

Sub HexSplitter()
Dim Cell As Range, HexNum As String
For Each Cell In Selection
HexNum = Right("0000" & Hex(Right(Cell.Value, 5)), 4)
Cell.Offset(0, 1).Value = "100.100.1." & CLng("&H" & Right(HexNum, 2))
Cell.Offset(0, 2).Value = "00-00-00-00-" & Format(HexNum, "@@-@@")
Next
End Sub

--
Rick (MVP - Excel)



"Ron" wrote in message
...
Oh yeah...if it could go down a certain number of rows, which I would tell
it, or until it hit a filled cell in Column B or C...that would help.

Thanks, wizards

"Ron" wrote:

3 columns:
A B C
042-0-0-01234 100.100.1.210 00-00-00-00-04-D2

I will have a list in column A, numerical...042-0-0-01234,042-0-0-01235,
etc
Column C will have a MAC and the last 2 segments are based on the last 5
of
column A. e.g. 01234 = 04D2 (first 4 segments are fixed)
Column B is decimal of last segment of column C, e.g. D2 = 210

I would like to scroll down column A, and fill in column B anc C, which I
am
doing manual right now.

Way beyond me.....Any ideas?

Thanks,
Ron


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Filling in columns counting by Hex

Well, my screaming to the engineers solved this. They are providng me with a
copy of their spreadsheet, with this all filled in. Both of these seem to
work for me and I use them differently on whether I needed a lot of a few.

Thanks so much for the help.

Ron

"Ron" wrote:

Sorry guys, I've been away...thanks for the responses, I'll see what works
and let you know.

"Rick Rothstein" wrote:

You didn't tell us how the front part of the values in Columns B and C are
specified, so I hard-coded what you showed us into the following macro (you
will have to adjust this on your own or tell us how this information is
derived so we can show you how to do it). Also your specification on which
cells to operate on was kind of sketchy, so I took the easy way out and
simply made the code operate on each cell in the current selection...

Sub HexSplitter()
Dim Cell As Range, HexNum As String
For Each Cell In Selection
HexNum = Right("0000" & Hex(Right(Cell.Value, 5)), 4)
Cell.Offset(0, 1).Value = "100.100.1." & CLng("&H" & Right(HexNum, 2))
Cell.Offset(0, 2).Value = "00-00-00-00-" & Format(HexNum, "@@-@@")
Next
End Sub

--
Rick (MVP - Excel)



"Ron" wrote in message
...
Oh yeah...if it could go down a certain number of rows, which I would tell
it, or until it hit a filled cell in Column B or C...that would help.

Thanks, wizards

"Ron" wrote:

3 columns:
A B C
042-0-0-01234 100.100.1.210 00-00-00-00-04-D2

I will have a list in column A, numerical...042-0-0-01234,042-0-0-01235,
etc
Column C will have a MAC and the last 2 segments are based on the last 5
of
column A. e.g. 01234 = 04D2 (first 4 segments are fixed)
Column B is decimal of last segment of column C, e.g. D2 = 210

I would like to scroll down column A, and fill in column B anc C, which I
am
doing manual right now.

Way beyond me.....Any ideas?

Thanks,
Ron


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filling a combo box with two Columns Jan T. Excel Programming 8 April 16th 07 10:42 PM
Filling Blancks in Columns with the containing of cell. Timo Hansen Excel Programming 1 November 4th 06 11:43 AM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Excel Programming 1 June 1st 05 04:10 PM
Filling values to columns Hilla Excel Programming 3 September 6th 04 02:02 PM
Add new Worksheet after filling first 256 columns m4nd4li4 Excel Programming 7 March 7th 04 07:58 AM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"