Hi Everyone,
I am a beginner to all of this so I apologise if I use the wrong terminology or I'm a bit slow with it all.
Anyway, basically I am trying to bring values from a table in another workbook into a cell using VLOOKUP.
I have mastered that but I cant seem to autofit the cell to fit the result which enters the cell (sometimes a paragraph long, other times nothing at all depending on the "customer" cell).
This means that there is a very large gap left behind when a large paragraph that I have accomodated for disappears.
I have realised that if there were a way to automatically autofit the cell to fit the size of the text then it wouldn't leave large gaps in the document.
I found a help topic on this very problem and attempted to use the VB code without success.
I have a feeling this is because there are certain words that need to be replaced to suit my excel document.
This is what I tried to insert :
Option Explicit
Private Sub Worksheet_Calculate()
me.Unprotect
Me.Rows("182").AutoFit
me.protect
End Sub
I tried this and it didnt work.
I tried changing the word "calculate" to the name of my worksheet "Data" which holds the tables used for the Vlookup.
I tried not using the unprotect/protect lines (not sure if they are needed)
I am also not sure if the line regarding which row to autofit has the correct syntax. I only want row 182 to autofit in order to allow a large paragraph or just one word.
I didnt change the first line as I assume this is necessary.
Could you please help me out.
Im sure this is a simple one for you guys.
As you can see I will need to be spoon fed through this one.
Thanks in advance
Bookmarks