Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I inherited a list of field heading that get built by hard coding as follows:
Range("A1").FormulaR1C1 = "Filed 1€¯ Range("B1").FormulaR1C1 = "Filed 2€¯ How can I increment for the start point of cell A1 omitting hard coded ranges? Im currently messing around with offset€¦ Appreciatively, Arturo |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe...
'Select some cells Sub MakeTitles() Dim rCell As Range For Each rCell In Application.Intersect(Selection.EntireColumn, Rows(1)).Cells rCell.Value = "Filed " & rCell.Column Next End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Arturo" wrote in message I inherited a list of field heading that get built by hard coding as follows: Range("A1").FormulaR1C1 = "Filed 1€¯ Range("B1").FormulaR1C1 = "Filed 2€¯ How can I increment for the start point of cell A1 omitting hard coded ranges? Im currently messing around with offset€¦ Appreciatively, Arturo |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I stated the issue incorrectly.
What I've got working now is: ActiveCell.Offset(0, 1).Select ActiveCell = "ABC" ActiveCell.Offset(0, 1).Select ActiveCell = "123" and so on... All the differing field headings reside in code. Is there a cleaner way to increment in the same line: ActiveCell.Offset(0, 1) and have it equal "XYZ", then the line of code would be ActiveCell.Offset(0, 1) and have it equal "LOB" and so on working from a long hard coded list. I hope this makes more sence... "Jim Cone" wrote: Maybe... 'Select some cells Sub MakeTitles() Dim rCell As Range For Each rCell In Application.Intersect(Selection.EntireColumn, Rows(1)).Cells rCell.Value = "Filed " & rCell.Column Next End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Arturo" wrote in message I inherited a list of field heading that get built by hard coding as follows: Range("A1").FormulaR1C1 = "Filed 1€¯ Range("B1").FormulaR1C1 = "Filed 2€¯ How can I increment for the start point of cell A1 omitting hard coded ranges? Im currently messing around with offset€¦ Appreciatively, Arturo |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 'Select some cells Sub MakeTitles_R1() Dim Ndx As Long Dim rHeadings As Range Dim vArray As Variant vArray = Array("Aqua", "Black", " Blue ", "Blue-Gray", " Bright Green ", _ "Brown", " Coral", " Dark Blue", " Dark Green") Set rHeadings = Application.Intersect(Selection.EntireColumn, Rows(1)).Cells For Ndx = 1 To Application.Min(rHeadings.Count, UBound(vArray) + 1) rHeadings(Ndx).Value = vArray(Ndx - 1) Next End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Arturo" wrote in message I stated the issue incorrectly. What I've got working now is: ActiveCell.Offset(0, 1).Select ActiveCell = "ABC" ActiveCell.Offset(0, 1).Select ActiveCell = "123" and so on... All the differing field headings reside in code. Is there a cleaner way to increment in the same line: ActiveCell.Offset(0, 1) and have it equal "XYZ", then the line of code would be ActiveCell.Offset(0, 1) and have it equal "LOB" and so on working from a long hard coded list. I hope this makes more sence... "Jim Cone" wrote: Maybe... 'Select some cells Sub MakeTitles() Dim rCell As Range For Each rCell In Application.Intersect(Selection.EntireColumn, Rows(1)).Cells rCell.Value = "Filed " & rCell.Column Next End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Arturo" wrote in message I inherited a list of field heading that get built by hard coding as follows: Range("A1").FormulaR1C1 = "Filed 1€¯ Range("B1").FormulaR1C1 = "Filed 2€¯ How can I increment for the start point of cell A1 omitting hard coded ranges? Im currently messing around with offset€¦ Appreciatively, Arturo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell offset issue | Excel Worksheet Functions | |||
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul | Excel Worksheet Functions | |||
Find, Copy offset to offset on other sheet, Run-time 1004. | Excel Programming | |||
Offset issue | Excel Programming | |||
Offset issue? | Excel Programming |