hey,
I want to enter both a string and a value into a cell but am unsure about the syntax.
I want to enter "Project a" where "a" is an integer that counts up from 1 so I would get "Project 1", "Project 2".....
thanks
hey,
I want to enter both a string and a value into a cell but am unsure about the syntax.
I want to enter "Project a" where "a" is an integer that counts up from 1 so I would get "Project 1", "Project 2".....
thanks
You could apply a Custom Format to the cells of:
"Project "0
and then put 1, 2, 3 etc in successive cells, or if you want a formula to copy down:
=MAX(A$1:A1)+1
in cell A2 and then copy that down.
Hope this helps.
Pete
yea that works but I am wanting to do it within VBA so that it inputs the new project name everytime I do a loop. I have it all working except the part of adding the number to the string.
Can you post the code you have?
If posting code please use code tags, see here.
[Private Sub CommandButton3_Click()
Sheets("Sheet1").Select
Range("A3").Select
Dim x, a, n, t As Integer
x = 0
a = 0
n = 2
Do Until Selection.Value = ""
Selection.Offset(1, 0).Select
x = x + 1
a = a + 1
Loop
Selection.Offset(5, 1).Value = Selection.Offset(2, 0).Value
x = x + 6
Selection.Offset(-a, n).Select
Do Until Selection.Value = ""
a = 0
Do Until Selection.Value = ""
Selection.Offset(1, 0).Select
a = a + 1
Loop
t=t+1
Selection.Offset((x - a), -n).Value = "Project" & "t"
Selection.Offset((x - a), (-n + 1)).Value = Selection.Offset(2, 0)
x = x + 1
Selection.Offset(-a, 2).Select
n = n + 2
Loop
End Sub]
the problem is the 7th to last line.. I dont know the proper syntax to make the t turn into its value.
Remove the quotes around t.
Oh, and please use code tags.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks