If list item in cell A contains X then insert signature in cell B

skuliaxe

New Member
Joined
Aug 3, 2011
Messages
3
Hi,

I´m new to the advanced functions in excel and really could use a little help.

What I need:
In Column A i have multiple list items down many rows. If the list in "Column A - Row 1" is anything but empty then in "Column B - Row 1" the current logged in UserName should print out (aka signature).

Why: (if anybody cares...)
I have multiple users that need to check that they have completed a given task in this excel list. I need the signtures to be automatic (ie true). If a user is logged into the computer then he can only add his signature. The users selects "Checked" og "Fixed" from the list and his signature is automatically added to the cell next to the list.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Try...
Code:
Sub LogIn()
Select Case Range("A1").Value
     Case Empty, "Fixed", "Checked"
          Range("B1").Value = Environ("username")
End Select
End Sub
 
Upvote 0
Try...
Code:
Sub LogIn()
Select Case Range("A1").Value
     Case Empty, "Fixed", "Checked"
          Range("B1").Value = Environ("username")
End Select
End Sub

Thanks,
This works for the list in A1. Is there any way to have one code for ALL list items? I have one list in each row (Column A, Rows 1 - 100). So if list in Column A Row X is set to "checked" then Column B Row X is populated with the signature?
 
Upvote 0
with Villy code
Code:
Sub LogIn()
Dim c As Range
For Each c In Range("a1:a100")
    Select Case cValue
        Case Empty, "Fixed", "Checked"
            c.Offset(, 1).Value = Environ("username")
    End Select
Next c
End Sub
 
Upvote 0
Almost there :)

Now if I select any value from one list, all rows next to it get filled with the signature. I would only like the cell next to the list to be filled if the list is not empty.
 
Upvote 0
Thanks,
This works for the list in A1. Is there any way to have one code for ALL list items? I have one list in each row (Column A, Rows 1 - 100). So if list in Column A Row X is set to "checked" then Column B Row X is populated with the signature?
Code:
 Sub LogIn()
For i = 1 to Range("A" & Rows.Count).End(xlUp).Row
 
Select Case Range("A" & i).Value
     Case Empty, "Fixed", "Checked"
          Range("B" & i).Value = Environ("username")
End Select
Next i
End Sub
 
Upvote 0
try this
Code:
Sub LogIn()
Dim c As Range, LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For Each c In Range("a1:a" & LR)
    Select Case cValue
        Case Empty, "Fixed", "Checked"
            c.Offset(, 1).Value = Environ("username")
    End Select
Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top