Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Concatenate then Fill Down

Hi

I have the VBA CODE of 24 lines

Range("A2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
Range("B2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
Range("C2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
,,,,,,
Range("V2").Formula = Range("AA2") & " / " & Range("BQ2") & " / " & Range
("BT2")

I want to fill these 24 columns down to lastrow in the Column AA. I dont
want to use R1C1.

Thanks in Advance

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201005/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Concatenate then Fill Down

First, you can use .formulaR1C1 and the user will still see the formulas the way
they have that option turned on in excel. Your code won't impact that.

Second, I think you made a mistake with your pattern. You have AG2 in 3 of the
4 sample lines.

Third, I'd populate the cells with a formula and then convert to values.

Dim LastRow as long
with activesheet 'I like qualifying my ranges
lastrow = .cells(.rows.count,"AA").end(xlup).row

with .range("A2:A" & lastrow)
.formula = "=AA2&"" / ""&AG2&"" / ""&AI2
.value = .value 'or do it later
end with

...etc

End With


You could even drop the .value = .value in each range and get them all at once:

with .Range("a2:V" & lastrow)
.value = .value
end with

====
This works just like excel would when you select the range (manually), then type
the formula based on the activecell in that selection, and hit ctrl-enter to
enter all the cells in the selection.

Excel is smart enough to adjust those formulas.

"FIRSTROUNDKO via OfficeKB.com" wrote:

Hi

I have the VBA CODE of 24 lines

Range("A2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
Range("B2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
Range("C2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
,,,,,,
Range("V2").Formula = Range("AA2") & " / " & Range("BQ2") & " / " & Range
("BT2")

I want to fill these 24 columns down to lastrow in the Column AA. I dont
want to use R1C1.

Thanks in Advance

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201005/1


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Concatenate then Fill Down

Thanks this was very helpful

Dave Peterson wrote:
First, you can use .formulaR1C1 and the user will still see the formulas the way
they have that option turned on in excel. Your code won't impact that.

Second, I think you made a mistake with your pattern. You have AG2 in 3 of the
4 sample lines.

Third, I'd populate the cells with a formula and then convert to values.

Dim LastRow as long
with activesheet 'I like qualifying my ranges
lastrow = .cells(.rows.count,"AA").end(xlup).row

with .range("A2:A" & lastrow)
.formula = "=AA2&"" / ""&AG2&"" / ""&AI2
.value = .value 'or do it later
end with

...etc

End With

You could even drop the .value = .value in each range and get them all at once:

with .Range("a2:V" & lastrow)
.value = .value
end with

====
This works just like excel would when you select the range (manually), then type
the formula based on the activecell in that selection, and hit ctrl-enter to
enter all the cells in the selection.

Excel is smart enough to adjust those formulas.

Hi

[quoted text clipped - 18 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201005/1



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201005/1

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Concatenate then Fill Down

ps. If these were dates, I wouldn't build the string that way, I'd use:

..formula = "=date(aa2,ag2,ai2)"

and format them nicely.

"FIRSTROUNDKO via OfficeKB.com" wrote:

Hi

I have the VBA CODE of 24 lines

Range("A2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
Range("B2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
Range("C2").Formula = Range("AA2") & " / " & Range("AG2") & " / " & Range
("AI2")
,,,,,,
Range("V2").Formula = Range("AA2") & " / " & Range("BQ2") & " / " & Range
("BT2")

I want to fill these 24 columns down to lastrow in the Column AA. I dont
want to use R1C1.

Thanks in Advance

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201005/1


--

Dave Peterson
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
Erase fill print then bring fill back Homer Excel Discussion (Misc queries) 5 September 26th 07 01:50 PM
Fill in form to type Item descrictions and costs and fill in funct cradino Excel Worksheet Functions 0 July 16th 06 08:44 PM
I have a list of data, fill in the gaps. FILL function won't work Triv Excel Discussion (Misc queries) 1 September 17th 05 02:33 PM
I know how to concatenate ,can one de-concatenate to split date? QUICK BOOKS PROBLEM- New Users to Excel 1 July 26th 05 05:07 PM
Concatenate Countif formula for VBA fill-in Dennis Excel Discussion (Misc queries) 3 June 24th 05 10:36 PM


All times are GMT +1. The time now is 06:54 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"