Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default If cell in column C = "insert" then OFFSET+CONCATENATE

I have a worksheet named "sales" with custom ad codes in Column C and sales
rep initials in Column H. I need to write a macro that will look at Column C
and for every size code = "insert" to offset + concatenate. So for example,
If a reps initials were ABC, for every cell in Column C = "insert" the cell
in the same row, column H should be equal to xxx-"ABC".
Is this possible? (currently, i go through a horrendous process involving
Indirect lookups and a copy/paste from a hidden worksheet -very clumsy even
though it works)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default If cell in column C = "insert" then OFFSET+CONCATENATE


Try something like:

sub Test()
DIM c as range
DIM r as long, i as long

With Sheets("Sales")
r=.cells(.rows.count, 3).End(xlUp).row
For each c in .range("C2:C" & r) 'assuming there is a header in C1
If c = "insert" then c.offset(0,5)="xxx-" & c.offset(0,5)
Next c
End with

End Sub

"Solutions Manager" wrote:

I have a worksheet named "sales" with custom ad codes in Column C and sales
rep initials in Column H. I need to write a macro that will look at Column C
and for every size code = "insert" to offset + concatenate. So for example,
If a reps initials were ABC, for every cell in Column C = "insert" the cell
in the same row, column H should be equal to xxx-"ABC".
Is this possible? (currently, i go through a horrendous process involving
Indirect lookups and a copy/paste from a hidden worksheet -very clumsy even
though it works)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default If cell in column C = "insert" then OFFSET+CONCATENATE

BINGO. BINGO. Thank you. Thank you. Thank you.

"cush" wrote:


Try something like:

sub Test()
DIM c as range
DIM r as long, i as long

With Sheets("Sales")
r=.cells(.rows.count, 3).End(xlUp).row
For each c in .range("C2:C" & r) 'assuming there is a header in C1
If c = "insert" then c.offset(0,5)="xxx-" & c.offset(0,5)
Next c
End with

End Sub

"Solutions Manager" wrote:

I have a worksheet named "sales" with custom ad codes in Column C and sales
rep initials in Column H. I need to write a macro that will look at Column C
and for every size code = "insert" to offset + concatenate. So for example,
If a reps initials were ABC, for every cell in Column C = "insert" the cell
in the same row, column H should be equal to xxx-"ABC".
Is this possible? (currently, i go through a horrendous process involving
Indirect lookups and a copy/paste from a hidden worksheet -very clumsy even
though it works)


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
If part of a cell = "NVA" then insert "Norfolk" in return cell RNCKWMN Excel Worksheet Functions 4 June 13th 09 08:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
Insert 19 cells "Shift to the right" if cell contains "-" robertjtucker[_4_] Excel Programming 5 July 25th 05 04:20 PM
Disabling "Entire &row/&column" in Delete/Insert Cell Gap Excel Programming 1 March 6th 05 03:42 PM


All times are GMT +1. The time now is 10:35 PM.

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

About Us

"It's about Microsoft Excel"