Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to write a macro that will insert one of a number of possible
logos depending on the "user group" name, which appears in a cell after data is downloaded to the worksheet. The following code stops at the line UserGroup=Selection.String - (highlighted yellow in the debug) - there is obviously something wrong with the syntax here and I have tried a number of things without success. I know it works in other situations where I use Dim CritValue as Integer and then do IF, THEN statements to act on different numbers of CritValue, but as this is text it doesn't work the same way. Can anyone help please? Dim UserGroup As String UserGroup = " " ActiveSheet.Unprotect ActiveSheet.Range("AJ1").Select UserGroup = Selection.String If UserGroup = "Garth Partnership" Then (the subsequent instructions to insert the logo work fine from a macro linked to an object but I want to automate this without the need for clicking on an object). Thanks in anticipation. -- pignick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro code to put series name next to individual line in line grap | Charts and Charting in Excel | |||
Combined VBA line syntax | Excel Programming | |||
VBE syntax line question | Excel Programming | |||
More on VBE syntax line question | Excel Programming | |||
VBA Row(line) No Syntax? | Excel Programming |